diff --git a/lib/checkcondition.cpp b/lib/checkcondition.cpp index 9b6834aef..1df4433a1 100644 --- a/lib/checkcondition.cpp +++ b/lib/checkcondition.cpp @@ -180,9 +180,9 @@ bool CheckCondition::assignIfParseScope(const Token * const assignTok, } if (Token::Match(tok2,"&&|%oror%|( %varid% ==|!= %num% &&|%oror%|)", varid)) { const Token *vartok = tok2->next(); - const std::string& op(vartok->strAt(1)); const MathLib::bigint num2 = MathLib::toLongNumber(vartok->strAt(2)); if ((num & num2) != ((bitop=='&') ? num2 : num)) { + const std::string& op(vartok->strAt(1)); const bool alwaysTrue = op == "!="; const std::string condition(vartok->str() + op + vartok->strAt(2)); assignIfError(assignTok, tok2, condition, alwaysTrue);