Skip to content

Commit

Permalink
Update tokenlist.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Oct 7, 2024
1 parent 91627c9 commit c5c70f5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/tokenlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1892,6 +1892,11 @@ void TokenList::validateAst(bool print) const
"' doesn't have two operands.",
InternalError::AST);
}
if (tok->str() == "case" && !tok->astOperand1()) {
throw InternalError(tok,
"Syntax Error: AST broken, 'case' doesn't have an operand.",
InternalError::AST);
}

// Check member access
if (Token::Match(tok, "%var% .")) {
Expand Down

0 comments on commit c5c70f5

Please sign in to comment.