Fixed CID 1037101 Dereference after null check in ExecutionPath::checkScope.
This commit is contained in:
parent
85496cfadc
commit
7920afdc60
|
@ -364,13 +364,13 @@ void ExecutionPath::checkScope(const Token *tok, std::list<ExecutionPath *> &che
|
||||||
}
|
}
|
||||||
|
|
||||||
// ; { ... }
|
// ; { ... }
|
||||||
if (Token::Match(tok->previous(), "[;{}:] {")) {
|
if (tok && Token::Match(tok->previous(), "[;{}:] {")) {
|
||||||
ExecutionPath::checkScope(tok->next(), checks);
|
ExecutionPath::checkScope(tok->next(), checks);
|
||||||
tok = tok->link();
|
tok = tok->link();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tok->str() == "if" && tok->next() && tok->next()->str() == "(") {
|
if (tok && tok->str() == "if" && tok->next() && tok->next()->str() == "(") {
|
||||||
// what variable ids should the numberOfIf be counted for?
|
// what variable ids should the numberOfIf be counted for?
|
||||||
std::set<unsigned int> countif;
|
std::set<unsigned int> countif;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue