Fixed two nullpointer messages in cppcheck
This commit is contained in:
parent
451a277b18
commit
9dfb864522
|
@ -635,7 +635,7 @@ bool Library::isScopeNoReturn(const Token *end, std::string *unknownFunc) const
|
||||||
|
|
||||||
const Token *funcname = end->linkAt(-2)->previous();
|
const Token *funcname = end->linkAt(-2)->previous();
|
||||||
const Token *start = funcname;
|
const Token *start = funcname;
|
||||||
if (funcname && Token::Match(funcname->tokAt(-3),"( * %name% )")) {
|
if (Token::Match(funcname->tokAt(-3),"( * %name% )")) {
|
||||||
funcname = funcname->previous();
|
funcname = funcname->previous();
|
||||||
start = funcname->tokAt(-3);
|
start = funcname->tokAt(-3);
|
||||||
} else if (funcname->isName()) {
|
} else if (funcname->isName()) {
|
||||||
|
|
|
@ -7567,9 +7567,11 @@ void Tokenizer::simplifyEnum()
|
||||||
//jump back once, see the comment at the end of the function
|
//jump back once, see the comment at the end of the function
|
||||||
goback = false;
|
goback = false;
|
||||||
tok = tok->previous();
|
tok = tok->previous();
|
||||||
|
if (!tok)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tok && tok->next() &&
|
if (tok->next() &&
|
||||||
(!tok->previous() || (tok->previous()->str() != "enum")) &&
|
(!tok->previous() || (tok->previous()->str() != "enum")) &&
|
||||||
Token::Match(tok, "class|struct|namespace")) {
|
Token::Match(tok, "class|struct|namespace")) {
|
||||||
className = tok->next()->str();
|
className = tok->next()->str();
|
||||||
|
|
Loading…
Reference in New Issue