Fixed CID 1037088 Dereference after null check in Tokenizer::simplifyLabelsCaseDefault.
This commit is contained in:
parent
7920afdc60
commit
6183f21070
|
@ -2211,7 +2211,7 @@ void Tokenizer::simplifyLabelsCaseDefault()
|
|||
if (Token::Match(tok->next(),"[:{};]"))
|
||||
break;
|
||||
}
|
||||
if (tok->str() != "case" && tok->next()->str() == ":") {
|
||||
if (tok->str() != "case" && tok->next() && tok->next()->str() == ":") {
|
||||
tok = tok->next();
|
||||
if (tok->next()->str() != ";")
|
||||
tok->insertToken(";");
|
||||
|
|
Loading…
Reference in New Issue