Skip to content

Commit

Permalink
Fix #12044 FN knownConditionTrueFalse comparing qualified constant wi…
Browse files Browse the repository at this point in the history
…th number
  • Loading branch information
chrchr-github committed Oct 6, 2023
1 parent fe8730c commit 78673b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/astutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1506,8 +1506,12 @@ bool isSameExpression(bool cpp, bool macro, const Token *tok1, const Token *tok2
if (cpp) {
if (tok1->str() == "." && tok1->astOperand1() && tok1->astOperand1()->str() == "this")
tok1 = tok1->astOperand2();
while (Token::simpleMatch(tok1, "::") && tok1->astOperand2())
tok1 = tok1->astOperand2();
if (tok2->str() == "." && tok2->astOperand1() && tok2->astOperand1()->str() == "this")
tok2 = tok2->astOperand2();
while (Token::simpleMatch(tok2, "::") && tok2->astOperand2())
tok2 = tok2->astOperand2();
}
// Skip double not
if (Token::simpleMatch(tok1, "!") && Token::simpleMatch(tok1->astOperand1(), "!") && !Token::simpleMatch(tok1->astParent(), "=") && astIsBoolLike(tok2)) {
Expand Down

0 comments on commit 78673b5

Please sign in to comment.