Memory leak : Removed checking of 'if(true)' and 'if(false)' as these are handled in the Tokenizer
This commit is contained in:
parent
7e43f9f7f9
commit
6a83e24c90
|
@ -467,14 +467,6 @@ TOKEN *CheckMemoryLeakClass::getcode(const TOKEN *tok, std::list<const TOKEN *>
|
||||||
{
|
{
|
||||||
addtoken("if(!var)");
|
addtoken("if(!var)");
|
||||||
}
|
}
|
||||||
else if ( TOKEN::Match(tok, "if ( true )") )
|
|
||||||
{
|
|
||||||
addtoken("if(true)");
|
|
||||||
}
|
|
||||||
else if ( TOKEN::Match(tok, "if ( false )") )
|
|
||||||
{
|
|
||||||
addtoken("if(false)");
|
|
||||||
}
|
|
||||||
else if ( TOKEN::Match(tok, "if") )
|
else if ( TOKEN::Match(tok, "if") )
|
||||||
{
|
{
|
||||||
// Check if the condition depends on var somehow..
|
// Check if the condition depends on var somehow..
|
||||||
|
@ -821,7 +813,7 @@ void CheckMemoryLeakClass::simplifycode(TOKEN *tok)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reduce "if* ;" that is not followed by an else..
|
// Reduce "if* ;" that is not followed by an else..
|
||||||
if (TOKEN::Match(tok2->next(), "if(var)|if(!var)|if(true)|if(false)|ifv ; !!else") )
|
if (TOKEN::Match(tok2->next(), "if(var)|if(!var)|ifv ; !!else") )
|
||||||
{
|
{
|
||||||
erase(tok2, tok2->tokAt(2));
|
erase(tok2, tok2->tokAt(2));
|
||||||
done = false;
|
done = false;
|
||||||
|
@ -866,13 +858,6 @@ void CheckMemoryLeakClass::simplifycode(TOKEN *tok)
|
||||||
done = false;
|
done = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reduce "if(true) X ;" => "X ;"
|
|
||||||
if (TOKEN::Match(tok2->next(), "if(true) %var% ; !!else") )
|
|
||||||
{
|
|
||||||
erase( tok2, tok2->tokAt(2) );
|
|
||||||
done = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( TOKEN::simpleMatch(tok2->next(), "loop") )
|
if ( TOKEN::simpleMatch(tok2->next(), "loop") )
|
||||||
{
|
{
|
||||||
// Replace "loop ;" with ";"
|
// Replace "loop ;" with ";"
|
||||||
|
|
Loading…
Reference in New Issue