Resolve CID 1037098

This commit is contained in:
Dmitry-Me 2014-08-12 10:02:54 +04:00
parent 263582ddbd
commit fd9009c494
1 changed files with 2 additions and 2 deletions

View File

@ -989,9 +989,9 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti
const std::size_t functions = functionScopes.size();
for (std::size_t i = 0; i < functions; ++i) {
const Scope *func = functionScopes[i];
for (const Token *tok = func->classStart->next(); tok != func->classEnd; tok = tok->next()) {
for (const Token *tok = func->classStart->next(); tok && tok != func->classEnd; tok = tok->next()) {
// check for member variable
if (tok && tok->varId() && tok->next() &&
if (tok->varId() && tok->next() &&
(tok->next()->str() == "." ||
(tok->next()->str() == "[" && tok->linkAt(1)->strAt(1) == "."))) {
const Token *tok1 = tok->next()->str() == "." ? tok->tokAt(2) : tok->linkAt(1)->tokAt(2);