Fix unit test failure (#4218)

This commit is contained in:
Paul Fultz II 2022-06-17 00:49:45 -05:00 committed by GitHub
parent 968d8d153e
commit 3612ddb3f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -575,7 +575,8 @@ struct ForwardTraversal {
tok = nextAfterAstRightmostLeaf(assignTok);
if (!tok)
return Break();
} else if (Token::simpleMatch(tok, ") {") && Token::Match(tok->link()->previous(), "for|while (")) {
} else if (Token::simpleMatch(tok, ") {") && Token::Match(tok->link()->previous(), "for|while (") &&
!Token::simpleMatch(tok->link()->astOperand2(), ":")) {
// In the middle of a loop structure so bail
return Break(Analyzer::Terminate::Bail);
} else if (tok->str() == ";" && tok->astParent()) {