Fix unit test failure (#4218)
This commit is contained in:
parent
968d8d153e
commit
3612ddb3f5
|
@ -575,7 +575,8 @@ struct ForwardTraversal {
|
||||||
tok = nextAfterAstRightmostLeaf(assignTok);
|
tok = nextAfterAstRightmostLeaf(assignTok);
|
||||||
if (!tok)
|
if (!tok)
|
||||||
return Break();
|
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
|
// In the middle of a loop structure so bail
|
||||||
return Break(Analyzer::Terminate::Bail);
|
return Break(Analyzer::Terminate::Bail);
|
||||||
} else if (tok->str() == ";" && tok->astParent()) {
|
} else if (tok->str() == ";" && tok->astParent()) {
|
||||||
|
|
Loading…
Reference in New Issue