CheckNullPointer: Use Tokenizer::IsScopeNoReturn
This commit is contained in:
parent
e4422558b6
commit
379440e2a4
|
@ -894,6 +894,16 @@ void CheckNullPointer::nullPointerByCheckAndDeRef()
|
|||
break;
|
||||
--indentlevel;
|
||||
|
||||
// calling exit function?
|
||||
bool unknown = false;
|
||||
if (_tokenizer->IsScopeNoReturn(tok2, &unknown))
|
||||
{
|
||||
if (_settings->inconclusive && unknown)
|
||||
inconclusive = true;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (null && indentlevel == 0) {
|
||||
// skip all "else" blocks because they are not executed in this execution path
|
||||
while (Token::simpleMatch(tok2, "} else {"))
|
||||
|
@ -912,10 +922,6 @@ void CheckNullPointer::nullPointerByCheckAndDeRef()
|
|||
break;
|
||||
}
|
||||
|
||||
if (Token::Match(tok2, "exit ( %num% ) ;")) {
|
||||
break;
|
||||
}
|
||||
|
||||
// parameters to sizeof are not dereferenced
|
||||
if (Token::Match(tok2, "decltype|sizeof")) {
|
||||
if (tok2->strAt(1) != "(")
|
||||
|
|
Loading…
Reference in New Issue