Symbol database: use in checkmemoryleaks.cpp. ticket: #2219

This commit is contained in:
Robert Reif 2010-12-09 06:15:01 +01:00 committed by Daniel Marjamäki
parent 3918aa4953
commit 4d2c210f2a
1 changed files with 10 additions and 9 deletions

View File

@ -3032,19 +3032,20 @@ void CheckMemoryLeakNoVar::check()
c.analyse(_tokenizer->tokens(), uvarFunctions);
}
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase();
std::list<SymbolDatabase::SpaceInfo *>::const_iterator i;
for (i = symbolDatabase->spaceInfoList.begin(); i != symbolDatabase->spaceInfoList.end(); ++i)
{
// Search for executable scopes..
if (!Token::Match(tok, ") const| {"))
SymbolDatabase::SpaceInfo *info = *i;
// only check functions
if (info->type != SymbolDatabase::SpaceInfo::Function)
continue;
// goto the "{"
tok = tok->next();
if (tok->str() != "{")
tok = tok->next();
// goto the "}" that ends the executable scope..
tok = tok->link();
const Token *tok = info->classEnd;
// parse the executable scope until tok is reached...
for (const Token *tok2 = tok->link(); tok2 && tok2 != tok; tok2 = tok2->next())