We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1f76c1 commit e101d72Copy full SHA for e101d72
1 file changed
lib/valueflow.cpp
@@ -4974,7 +4974,7 @@ static const Token* getConditionVariable(const Token* tok)
4974
if (const Token* parent = tok->astParent()) {
4975
if (Token::Match(parent, "%oror%|&&|?") ||
4976
Token::Match(parent->previous(), "if|while (") ||
4977
- (parent->str() == ";" && Token::simpleMatch(parent->astParent(), ";"))) {
+ (parent->str() == ";" && astIsLHS(tok) && Token::simpleMatch(parent->astParent(), ";"))) { // for loop condition
4978
if (Token::simpleMatch(tok, "="))
4979
return tok->astOperand1();
4980
if (!Token::Match(tok, "%comp%|%assign%"))
0 commit comments