Skip to content

Commit 046e0da

Browse files
Update checknullpointer.cpp
1 parent 20e63bc commit 046e0da

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/checknullpointer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ bool CheckNullPointer::isPointerDeRef(const Token *tok, bool &unknown, const Set
187187
// declaration of function pointer
188188
if (tok->variable() && tok->variable()->nameToken() == tok)
189189
return false;
190+
if ((tok->valueType() && tok->valueType()->pointer == 0) && !astIsIterator(tok) && !astIsSmartPointer(tok))
191+
return false;
190192
if (!addressOf)
191193
return true;
192194
}

0 commit comments

Comments
 (0)