Fixed #3725: Associate functions with correct parent scope when definition doesn't directly follow declaration.
This commit is contained in:
parent
31a252b057
commit
ebf89aa229
|
@ -915,11 +915,10 @@ Function* SymbolDatabase::addGlobalFunction(Scope*& scope, const Token*& tok, co
|
|||
function->token = funcStart;
|
||||
function->hasBody = true;
|
||||
|
||||
Scope* old_scope = scope;
|
||||
addNewFunction(&scope, &tok);
|
||||
|
||||
if (scope) {
|
||||
scope->function = &old_scope->functionList.back();
|
||||
scope->function = function;
|
||||
return function;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue