Skip to content

Commit b892d2e

Browse files
amai2012danmar
authored andcommitted
Fixed cppcheck-opensource#4300 (segmentation fault of cppcheck (invalid code))
1 parent 2a660fa commit b892d2e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/tokenize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8471,7 +8471,7 @@ void Tokenizer::simplifyStructDecl()
84718471
tok = tok->next()->link();
84728472

84738473
// unnamed anonymous struct/union so possibly remove it
8474-
if (tok->next() && tok->next()->str() == ";") {
8474+
if (tok && tok->next() && tok->next()->str() == ";") {
84758475
if (tok1->str() == "union" && inFunction) {
84768476
// Try to create references in the union..
84778477
Token *tok2 = tok1->tokAt(2);

0 commit comments

Comments
 (0)