Skip to content

Commit e1230e1

Browse files
Update tokenlist.cpp
1 parent 4869ae5 commit e1230e1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/tokenlist.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,8 +1946,8 @@ void TokenList::validateAst(bool print) const
19461946
// Syntax error if binary operator only has 1 operand
19471947
if ((tok->isAssignmentOp() || tok->isComparisonOp() || Token::Match(tok,"[|^/%]")) && tok->astOperand1() && !tok->astOperand2())
19481948
throw InternalError(tok, "Syntax Error: AST broken, binary operator has only one operand.", InternalError::AST);
1949-
1950-
if (isC() && !(tok->astOperand1() && tok->astOperand2()) && Token::Match(tok, "&&|%or%|%oror%"))
1949+
1950+
if (!(tok->astOperand1() && tok->astOperand2()) && ((isC() && tok->str() == "&&") || Token::Match(tok, "%or%|%oror%")))
19511951
throw InternalError(tok, "Syntax Error: AST broken, binary operator is missing operand(s).", InternalError::AST);
19521952

19531953
// Syntax error if we encounter "?" with operand2 that is not ":"

0 commit comments

Comments
 (0)