From 293437bdfcdd07881694350effcfd34a1ee7a541 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Mon, 26 Dec 2011 03:21:23 +0100 Subject: [PATCH] Fixed ticket #3416 (segmentation fault of cppcheck) --- lib/tokenize.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index ca1afa218..b3b45b61c 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -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();