Merge pull request #508 from Dmitry-Me/breakLoopEarly2

Break loop early
This commit is contained in:
Daniel Marjamäki 2015-02-04 08:52:23 +01:00
commit 73d14d0a9a
1 changed files with 3 additions and 2 deletions

View File

@ -1742,9 +1742,10 @@ void CheckOther::checkIncompleteStatement()
// bailout if there is a "? :" in this statement
bool bailout = false;
for (const Token *tok2 = tok->tokAt(2); tok2; tok2 = tok2->next()) {
if (tok2->str() == "?")
if (tok2->str() == "?") {
bailout = true;
else if (tok2->str() == ";")
break;
} else if (tok2->str() == ";")
break;
}
if (bailout)