Fixed #2457 (CheckOther::checkIncorrectLogicOperator: hang if variable id is 0)

This commit is contained in:
Zachary Blair 2011-01-16 13:57:29 -08:00
parent 9c300813a4
commit 481907ef14
1 changed files with 4 additions and 0 deletions

View File

@ -254,7 +254,11 @@ void CheckOther::checkIncorrectLogicOperator()
{
const unsigned int varId = term1Tok->varId();
if (!varId)
{
tok = Token::findmatch(endTok->next(), conditionPattern);
endTok = tok ? tok->next()->link() : NULL;
continue;
}
firstConstant = term1Tok->tokAt(2)->str();
if (Token::Match(term2Tok, "%varid% != %num%", varId))