Fixed #1716 (Wrong reporting of leak with close() in a while loop condition)

This commit is contained in:
Daniel Marjamäki 2010-05-29 22:20:10 +02:00
parent 0c6352a826
commit 46b5e4e79a
2 changed files with 2 additions and 1 deletions

View File

@ -5666,7 +5666,7 @@ bool Tokenizer::simplifyRedundantParanthesis()
ret = true;
}
while (Token::Match(tok->previous(), "[;{] ( %var% (") &&
while (Token::Match(tok->previous(), "[;{(] ( %var% (") &&
tok->link()->previous() == tok->tokAt(2)->link())
{
// We have "( func ( *something* ))", remove the outer

View File

@ -553,6 +553,7 @@ private:
void parantheses1()
{
ASSERT_EQUALS("<= 110 ;", tok("<= (10+100);"));
ASSERT_EQUALS("while ( x ( ) == -1 ) { }", tok("while((x()) == -1){ }"));
}
void paranthesesVar()