Fixed ticket #3416 (segmentation fault of cppcheck)

This commit is contained in:
Edoardo Prezioso 2011-12-26 03:21:23 +01:00
parent e112bfdd47
commit 293437bdfc
1 changed files with 3 additions and 3 deletions

View File

@ -6597,10 +6597,10 @@ void Tokenizer::simplifyInitVar()
if (!tok->isName() || (tok->previous() && !Token::Match(tok->previous(), "[;{}]")))
continue;
if (Token::Match(tok, "class|struct|union| %type% *| *| *| %var% ( &|*| *| *| %any% ) ;") ||
Token::Match(tok, "%type% *| *| *| %var% ( %type% (")) {
if (Token::Match(tok, "class|struct|union| %type% *| %var% ( &| %any% ) ;") ||
Token::Match(tok, "%type% *| %var% ( %type% (")) {
tok = initVar(tok);
} else if (Token::Match(tok, "class|struct|union| %type% *| *| *| %var% ( &|*| *| *| %any% ) ,")) {
} else if (Token::Match(tok, "class|struct|union| %type% *| %var% ( &| %any% ) ,")) {
Token *tok1 = tok;
while (tok1->str() != ",")
tok1 = tok1->next();