From 2a3cce50019e1b24b5e3255c2f439bc44b572134 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Sun, 23 Jan 2011 08:41:31 +0100 Subject: [PATCH] Symbol database: fixed corruptions. ticket: #2468 --- lib/symboldatabase.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index dd288b5c6..ff4434098 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -217,11 +217,13 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti function.isPure = true; // count the number of constructors - if (function.type == Function::eConstructor || function.type == Function::eCopyConstructor) + if (function.type == Function::eConstructor || + function.type == Function::eCopyConstructor) scope->numConstructors++; // assume implementation is inline (definition and implementation same) function.token = function.tokenDef; + function.arg = function.argDef; // out of line function if (Token::Match(end, ") const| ;") || @@ -238,7 +240,6 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti { function.isInline = true; function.hasBody = true; - function.arg = function.argDef; scope->functionList.push_back(function); @@ -831,6 +832,7 @@ void SymbolDatabase::addNewFunction(Scope **scope, const Token **tok) // syntax error? if (!new_scope->classEnd) { + (*scope)->nestedList.pop_back(); delete new_scope; while (tok1->next()) tok1 = tok1->next(); @@ -848,6 +850,7 @@ void SymbolDatabase::addNewFunction(Scope **scope, const Token **tok) } else { + (*scope)->nestedList.pop_back(); delete new_scope; *scope = NULL; *tok = NULL;