From 780719665f35a02ced788ee35d469e977033d9a2 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Sun, 18 May 2014 13:35:00 +0200 Subject: [PATCH] Fixed crash when checking tinyxml introduced by previous commit --- lib/checkother.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 7f1027e68..602e168bc 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -423,16 +423,16 @@ void CheckOther::clarifyStatement() for (std::size_t i = 0; i < functions; ++i) { const Scope * scope = symbolDatabase->functionScopes[i]; for (const Token* tok = scope->classStart; tok && tok != scope->classEnd; tok = tok->next()) { - if (Token::Match(tok, "* %var%")) { + if (Token::Match(tok, "* %var%") && tok->astOperand1()) { const Token *tok2=tok->previous(); while (tok2 && tok2->str() == "*") - tok2=tok2->previous(); + tok2 = tok2->previous(); if (Token::Match(tok2, "[{};]")) { - tok = tok->astOperand1(); - if (Token::Match(tok, "++|-- [;,]")) - clarifyStatementError(tok); + tok2 = tok->astOperand1(); + if (Token::Match(tok2, "++|-- [;,]")) + clarifyStatementError(tok2); } } }