Fixed the testcase TestMemleak::realloc3

This commit is contained in:
Daniel Marjamäki 2009-03-23 18:34:59 +01:00
parent 7905cbc5e7
commit 06776c6ac7
2 changed files with 23 additions and 22 deletions

View File

@ -330,10 +330,11 @@ bool CheckMemoryLeakClass::notvar(const Token *tok, const char *varnames[], bool
const std::string end(endpar ? " )" : " [;)&|]");
return bool(Token::Match(tok, std::string("! " + varname + end).c_str()) ||
Token::simpleMatch(tok, std::string("! ( " + varname + " )" + end).c_str()) ||
Token::Match(tok, std::string("0 == " + varname + end).c_str()) ||
Token::simpleMatch(tok, std::string(varname + " == 0" + end).c_str()));
return bool(Token::Match(tok, ("! " + varname + end).c_str()) ||
Token::Match(tok, ("! ( " + varname + " )" + end).c_str()) ||
Token::Match(tok, ("0 == " + varname + end).c_str()) ||
Token::Match(tok, (varname + " == 0" + end).c_str()) ||
Token::Match(tok, ("( " + varname + " ) == 0" + end).c_str()));
}
Token *CheckMemoryLeakClass::getcode(const Token *tok, std::list<const Token *> callstack, const char varname[], AllocType &alloctype, AllocType &dealloctype, bool classmember, bool &all, unsigned int sz)

View File

@ -164,7 +164,7 @@ private:
TEST_CASE(realloc1);
TEST_CASE(realloc2);
// TODO TEST_CASE(realloc3);
TEST_CASE(realloc3);
TEST_CASE(assign);