value flow: improved checking of do-while loops for non-local variables

This commit is contained in:
Daniel Marjamäki 2014-01-12 15:02:58 +01:00
parent 5b679fc732
commit 155990cb0e
1 changed files with 1 additions and 1 deletions

View File

@ -256,7 +256,7 @@ static void valueFlowBeforeCondition(TokenList *tokenlist, ErrorLogger *errorLog
// Global variable : stop when leaving the function scope
if (!var->isLocal()) {
if (!Token::Match(tok2->previous(), ")|else {"))
if (!Token::Match(tok2->previous(), ")|else|do {"))
break;
if (Token::Match(tok2->previous(), ") {") &&
!Token::Match(tok2->linkAt(-1)->previous(), "if|for|while ("))