From ebf89aa22992128a7b2ad47f21f71f4c493cfc88 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Wed, 25 Apr 2012 20:52:59 +0200 Subject: [PATCH] Fixed #3725: Associate functions with correct parent scope when definition doesn't directly follow declaration. --- lib/symboldatabase.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 5c2f9020b..e14740b10 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -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;