memleak: commented out the switch handling temporarily. it causes

segmentation faults when checking the linux kernel.
This commit is contained in:
Daniel Marjamäki 2008-08-30 18:42:26 +00:00
parent ae322b5f45
commit b88fd769a7
2 changed files with 7 additions and 6 deletions

View File

@ -146,14 +146,14 @@ static void MemoryLeak( const TOKEN *tok, const char varname[] )
ReportErr( errmsg.str() ); ReportErr( errmsg.str() );
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
/*
static void instoken(TOKEN *tok, const char str[]) static void instoken(TOKEN *tok, const char str[])
{ {
TOKEN *newtok = new TOKEN; TOKEN *newtok = new TOKEN;
memcpy( newtok, tok, sizeof(TOKEN) ); memcpy( newtok, tok, sizeof(TOKEN) );
newtok->str = strdup(str); newtok->str = strdup(str);
tok->next = newtok; tok->next = newtok;
} }*/
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -453,7 +453,7 @@ static void CheckMemoryLeak_CheckScope( const TOKEN *Tok1, const char varname[]
erase(tok2, gettok(tok2,3)); erase(tok2, gettok(tok2,3));
done = false; done = false;
} }
/*
// Replace switch with if (if not complicated) // Replace switch with if (if not complicated)
if (Match(tok2, "switch {")) if (Match(tok2, "switch {"))
{ {
@ -514,7 +514,8 @@ static void CheckMemoryLeak_CheckScope( const TOKEN *Tok1, const char varname[]
tok2 = tok2->next->next; tok2 = tok2->next->next;
} }
} }
} }
*/
} }
} }

View File

@ -49,8 +49,8 @@ public:
TEST_CASE( forwhile3 ); TEST_CASE( forwhile3 );
TEST_CASE( forwhile4 ); TEST_CASE( forwhile4 );
TEST_CASE( switch1 ); //TEST_CASE( switch1 );
TEST_CASE( switch2 ); //TEST_CASE( switch2 );
TEST_CASE( mismatch1 ); TEST_CASE( mismatch1 );