Fixed #4300 (segmentation fault of cppcheck (invalid code))

This commit is contained in:
Alexander Mai 2013-02-16 18:31:43 +01:00 committed by Daniel Marjamki
parent 2a660fa3b4
commit b892d2e14c
1 changed files with 1 additions and 1 deletions

View File

@ -8471,7 +8471,7 @@ void Tokenizer::simplifyStructDecl()
tok = tok->next()->link();
// unnamed anonymous struct/union so possibly remove it
if (tok->next() && tok->next()->str() == ";") {
if (tok && tok->next() && tok->next()->str() == ";") {
if (tok1->str() == "union" && inFunction) {
// Try to create references in the union..
Token *tok2 = tok1->tokAt(2);