Fix #1532 (hang due to commit 772aa95c8a
)
http://sourceforge.net/apps/trac/cppcheck/ticket/1532
This commit is contained in:
parent
a18c964efa
commit
86fabd03b3
|
@ -6672,6 +6672,8 @@ void Tokenizer::simplifyStructInit()
|
||||||
tok2 = tok2->tokAt(4);
|
tok2 = tok2->tokAt(4);
|
||||||
else if (Token::Match(tok2, ". %type% = & %var% [,}]"))
|
else if (Token::Match(tok2, ". %type% = & %var% [,}]"))
|
||||||
tok2 = tok2->tokAt(5);
|
tok2 = tok2->tokAt(5);
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
|
||||||
if (Token::simpleMatch(tok2, ", ."))
|
if (Token::simpleMatch(tok2, ", ."))
|
||||||
tok2 = tok2->next();
|
tok2 = tok2->next();
|
||||||
|
|
|
@ -4128,6 +4128,7 @@ private:
|
||||||
ASSERT_EQUALS("; struct A a ; a . buf = x ;", tok("; struct A a = { .buf = x };"));
|
ASSERT_EQUALS("; struct A a ; a . buf = x ;", tok("; struct A a = { .buf = x };"));
|
||||||
ASSERT_EQUALS("; struct A a ; a . buf = & key ;", tok("; struct A a = { .buf = &key };"));
|
ASSERT_EQUALS("; struct A a ; a . buf = & key ;", tok("; struct A a = { .buf = &key };"));
|
||||||
ASSERT_EQUALS("; struct ABC abc ; abc . a = 3 ; abc . b = x ; abc . c = & key ;", tok("; struct ABC abc = { .a = 3, .b = x, .c = &key };"));
|
ASSERT_EQUALS("; struct ABC abc ; abc . a = 3 ; abc . b = x ; abc . c = & key ;", tok("; struct ABC abc = { .a = 3, .b = x, .c = &key };"));
|
||||||
|
TODO_ASSERT_EQUALS("; struct A a ; a . buf = { 0 } ;", tok("; struct A a = { .buf = {0} };"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void simplifyStructDecl()
|
void simplifyStructDecl()
|
||||||
|
|
Loading…
Reference in New Issue