From 7b3493322d6ee71a48f9d22290fb8bc655d48d4c Mon Sep 17 00:00:00 2001 From: PKEuS Date: Fri, 15 Feb 2013 11:17:14 -0800 Subject: [PATCH] Fixed crash when running cppcheck on itself introduced in previous commit --- lib/checkother.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 909631a35..5488561c6 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -720,7 +720,7 @@ void CheckOther::checkRedundantAssignment() else if (Token::Match(tok2, "%var% (") && nonLocal(tok->variable())) { // Called function might use the variable const Function* func = symbolDatabase->findFunction(tok2); const Variable* var = tok->variable(); - if (!var || var->isGlobal() || var->isReference() || ((!func || func->functionScope->functionOf) && tok2->strAt(-1) != ".")) // Global variable, or member function + if (!var || var->isGlobal() || var->isReference() || ((!func || !func->functionScope || func->functionScope->functionOf) && tok2->strAt(-1) != ".")) // Global variable, or member function error = false; } }