Skip to content

Commit 3612ddb

Browse files
authored
Fix unit test failure (#4218)
1 parent 968d8d1 commit 3612ddb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/forwardanalyzer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,8 @@ struct ForwardTraversal {
575575
tok = nextAfterAstRightmostLeaf(assignTok);
576576
if (!tok)
577577
return Break();
578-
} else if (Token::simpleMatch(tok, ") {") && Token::Match(tok->link()->previous(), "for|while (")) {
578+
} else if (Token::simpleMatch(tok, ") {") && Token::Match(tok->link()->previous(), "for|while (") &&
579+
!Token::simpleMatch(tok->link()->astOperand2(), ":")) {
579580
// In the middle of a loop structure so bail
580581
return Break(Analyzer::Terminate::Bail);
581582
} else if (tok->str() == ";" && tok->astParent()) {

0 commit comments

Comments
 (0)