Revert "checkautovariable: fix #7818, crash when accessing nullpointer tok2->next()."

This reverts commit a5d32aa7a5.
This commit is contained in:
Daniel Marjamäki 2016-11-20 17:21:56 +01:00
parent c329887bfe
commit 4388435ce1
1 changed files with 1 additions and 1 deletions

View File

@ -471,7 +471,7 @@ void CheckAutoVariables::returnReference()
// have we reached a function that returns a reference?
if (tok->previous() && tok->previous()->str() == "&") {
for (const Token *tok2 = scope->classStart->next(); tok2 && tok2 != scope->classEnd && tok2->next(); tok2 = tok2->next()) {
for (const Token *tok2 = scope->classStart->next(); tok2 && tok2 != scope->classEnd; tok2 = tok2->next()) {
if (!tok2->scope()->isExecutable()) {
tok2 = tok2->scope()->classEnd;
continue;