Fix #580 (double free not found)
http://sourceforge.net/apps/trac/cppcheck/ticket/580
This commit is contained in:
parent
13fbd616da
commit
c55140d4cd
|
@ -2266,7 +2266,7 @@ bool Tokenizer::simplifyConditions()
|
||||||
if ((tok->str() == "&&" || tok->str() == "||" || tok->str() == "(") &&
|
if ((tok->str() == "&&" || tok->str() == "||" || tok->str() == "(") &&
|
||||||
(Token::Match(tok->tokAt(1), "%num% %any% %num%") ||
|
(Token::Match(tok->tokAt(1), "%num% %any% %num%") ||
|
||||||
Token::Match(tok->tokAt(1), "%bool% %any% %bool%")) &&
|
Token::Match(tok->tokAt(1), "%bool% %any% %bool%")) &&
|
||||||
(tok4->str() == "&&" || tok4->str() == "||" || tok4->str() == ")"))
|
(tok4->str() == "&&" || tok4->str() == "||" || tok4->str() == ")" || tok4->str() == "?"))
|
||||||
{
|
{
|
||||||
std::string cmp = tok->strAt(2);
|
std::string cmp = tok->strAt(2);
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
|
@ -1890,7 +1890,7 @@ private:
|
||||||
" if (13>12?true:false);\n"
|
" if (13>12?true:false);\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
TODO_ASSERT_EQUALS("void f ( ) { { ; } }", tok(code));
|
ASSERT_EQUALS("void f ( ) { { ; } }", tok(code));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue