Merge pull request #391 from Dmitry-Me/resolveIssue1037098

Resolve CID 1037098
This commit is contained in:
PKEuS 2014-09-06 23:17:52 +02:00
commit 605fb9039a
1 changed files with 2 additions and 2 deletions

View File

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