value flow: improved checking of do-while loops for non-local variables
This commit is contained in:
parent
5b679fc732
commit
155990cb0e
|
@ -256,7 +256,7 @@ static void valueFlowBeforeCondition(TokenList *tokenlist, ErrorLogger *errorLog
|
||||||
|
|
||||||
// Global variable : stop when leaving the function scope
|
// Global variable : stop when leaving the function scope
|
||||||
if (!var->isLocal()) {
|
if (!var->isLocal()) {
|
||||||
if (!Token::Match(tok2->previous(), ")|else {"))
|
if (!Token::Match(tok2->previous(), ")|else|do {"))
|
||||||
break;
|
break;
|
||||||
if (Token::Match(tok2->previous(), ") {") &&
|
if (Token::Match(tok2->previous(), ") {") &&
|
||||||
!Token::Match(tok2->linkAt(-1)->previous(), "if|for|while ("))
|
!Token::Match(tok2->linkAt(-1)->previous(), "if|for|while ("))
|
||||||
|
|
Loading…
Reference in New Issue