Fix #796 (segmentation fault while scanning)
http://sourceforge.net/apps/trac/cppcheck/ticket/796
This commit is contained in:
parent
36fb24b1a5
commit
2e69d50458
|
@ -2940,7 +2940,7 @@ void Tokenizer::simplifyIfAssign()
|
|||
// Skip the "%var% = ..."
|
||||
Token *tok2;
|
||||
unsigned int indentlevel = 0;
|
||||
for (tok2 = tok; tok2; tok2 = tok2->next())
|
||||
for (tok2 = tok->next(); tok2; tok2 = tok2->next())
|
||||
{
|
||||
if (tok2->str() == "(")
|
||||
++indentlevel;
|
||||
|
|
|
@ -1188,6 +1188,7 @@ private:
|
|||
ASSERT_EQUALS("; a = b ( ) ; if ( ( a ) ) { ; }", simplifyIfAssign(";if((a=b()));"));
|
||||
ASSERT_EQUALS("; a = b ( ) ; if ( ! ( a ) ) { ; }", simplifyIfAssign(";if(!(a=b()));"));
|
||||
ASSERT_EQUALS("; a . x = b ( ) ; if ( ! ( a . x ) ) { ; }", simplifyIfAssign(";if(!(a->x=b()));"));
|
||||
ASSERT_EQUALS("A ( ) a = b ; if ( a ) { ; }", simplifyIfAssign("A() if(a=b);"));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue