From 4388435ce152986f1cd08efedc82161597559563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 20 Nov 2016 17:21:56 +0100 Subject: [PATCH] Revert "checkautovariable: fix #7818, crash when accessing nullpointer tok2->next()." This reverts commit a5d32aa7a5e3a992df7cb6b39e4771ccfaa36270. --- lib/checkautovariables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkautovariables.cpp b/lib/checkautovariables.cpp index f4a3fe75c..38edb76f4 100644 --- a/lib/checkautovariables.cpp +++ b/lib/checkautovariables.cpp @@ -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;