diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 8899aa9b8..fa17b46dc 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -5134,8 +5134,8 @@ void Tokenizer::simplifyVarDecl(bool only_k_r_fpar) const Token *VarTok = type0->tokAt((int)typelen); while (Token::Match(VarTok, "*|&|const")) VarTok = VarTok->next(); - if (!VarTok) - break; // ticket 4245 - invalid code probably + if (!VarTok) + break; // ticket 4245 - invalid code probably list.insertTokens(eq, VarTok, 2); eq->str(";"); diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index cfd38c763..c7a18de52 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -652,7 +652,7 @@ private: void tokenize25() { tokenizeAndStringify("f ( struct { int typedef T x ; } ) { }"); } - + // #4245 - segfault void tokenize26() { tokenizeAndStringify("class x { protected : template < int y = } ;");