Fixed #2632 (segmentation fault of cppcheck ( void>(); void>() ))
This commit is contained in:
parent
bea3875386
commit
5a0ec56fc2
|
@ -8723,6 +8723,9 @@ void Tokenizer::simplifyComparisonOrder()
|
|||
{
|
||||
if (!tok->next()->isName() && !tok->next()->isNumber())
|
||||
continue;
|
||||
const Token *operand2 = tok->tokAt(3);
|
||||
if (!operand2->isName() && !operand2->isNumber())
|
||||
continue;
|
||||
const std::string op1(tok->strAt(1));
|
||||
tok->next()->str(tok->strAt(3));
|
||||
tok->tokAt(3)->str(op1);
|
||||
|
|
|
@ -4598,6 +4598,8 @@ private:
|
|||
{
|
||||
ASSERT_EQUALS("( i < 10 )", tokenizeAndStringify("(10>i)"));
|
||||
ASSERT_EQUALS("; i < 10 ;", tokenizeAndStringify(";10>i;"));
|
||||
ASSERT_EQUALS("void > ( ) ; void > ( )",
|
||||
tokenizeAndStringify("void>(); void>()"));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue