diff --git a/lib/checkother.cpp b/lib/checkother.cpp index d0178a211..309ef2f9f 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -253,6 +253,8 @@ void CheckOther::checkIncorrectLogicOperator() if (Token::Match(term1Tok, "%var% != %num%")) { const unsigned int varId = term1Tok->varId(); + if (!varId) + continue; firstConstant = term1Tok->tokAt(2)->str(); if (Token::Match(term2Tok, "%varid% != %num%", varId))