Fixed ticket #3416 (segmentation fault of cppcheck)
This commit is contained in:
parent
e112bfdd47
commit
293437bdfc
|
@ -6597,10 +6597,10 @@ void Tokenizer::simplifyInitVar()
|
||||||
if (!tok->isName() || (tok->previous() && !Token::Match(tok->previous(), "[;{}]")))
|
if (!tok->isName() || (tok->previous() && !Token::Match(tok->previous(), "[;{}]")))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (Token::Match(tok, "class|struct|union| %type% *| *| *| %var% ( &|*| *| *| %any% ) ;") ||
|
if (Token::Match(tok, "class|struct|union| %type% *| %var% ( &| %any% ) ;") ||
|
||||||
Token::Match(tok, "%type% *| *| *| %var% ( %type% (")) {
|
Token::Match(tok, "%type% *| %var% ( %type% (")) {
|
||||||
tok = initVar(tok);
|
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;
|
Token *tok1 = tok;
|
||||||
while (tok1->str() != ",")
|
while (tok1->str() != ",")
|
||||||
tok1 = tok1->next();
|
tok1 = tok1->next();
|
||||||
|
|
Loading…
Reference in New Issue