fixed cppcheck inconclusive warning, possible null pointer dereference otherwise condition is redundant

This commit is contained in:
Daniel Marjamäki 2012-02-11 08:07:19 +01:00
parent ca5e9740b4
commit 4511d0fe5f
1 changed files with 5 additions and 0 deletions

View File

@ -402,6 +402,11 @@ void ExecutionPath::checkScope(const Token *tok, std::list<ExecutionPath *> &che
if (tok && tok->str() == "if") if (tok && tok->str() == "if")
continue; continue;
if (!tok) {
ExecutionPath::bailOut(newchecks);
return;
}
// there is no "if".. // there is no "if"..
ExecutionPath::checkScope(tok->next(), checks); ExecutionPath::checkScope(tok->next(), checks);
tok = tok->link(); tok = tok->link();