Memory leak : Fixed issue 2429936 - false positive reported on the break in the code "loop { dealloc ; alloc ; if break ; }"
This commit is contained in:
parent
87de37bcb4
commit
b145bf3650
|
@ -785,6 +785,17 @@ void CheckMemoryLeakClass::simplifycode(TOKEN *tok)
|
|||
{
|
||||
erase( tok2, tok2->tokAt(4) );
|
||||
done = false;
|
||||
}
|
||||
|
||||
// Reduce "loop { assign|dealloc|use ; alloc ; if break ; }" to "assign|dealloc|use ; alloc ;"
|
||||
if ( TOKEN::Match( tok2->next(), "loop { assign|dealloc|use ; alloc ; if break|continue ; }" ) )
|
||||
{
|
||||
// erase "loop {"
|
||||
erase( tok2, tok2->tokAt(3) );
|
||||
// erase "if break|continue ; }"
|
||||
tok2 = tok2->next()->next()->next()->next();
|
||||
erase( tok2, tok2->tokAt(5) );
|
||||
done = false;
|
||||
}
|
||||
|
||||
// Reduce "if(true) X ;" => "X ;"
|
||||
|
|
|
@ -97,7 +97,7 @@ private:
|
|||
TEST_CASE( forwhile5 );
|
||||
TEST_CASE( forwhile6 );
|
||||
TEST_CASE( forwhile7 );
|
||||
// TODO TEST_CASE( forwhile8 ); // Bug 2429936
|
||||
TEST_CASE( forwhile8 ); // Bug 2429936
|
||||
|
||||
TEST_CASE( dowhile1 );
|
||||
|
||||
|
|
Loading…
Reference in New Issue