summaryrefslogtreecommitdiffstats
path: root/lib/Checker/CheckDeadStores.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Checker/CheckDeadStores.cpp')
-rw-r--r--lib/Checker/CheckDeadStores.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Checker/CheckDeadStores.cpp b/lib/Checker/CheckDeadStores.cpp
index 4a7ca70..31f9390 100644
--- a/lib/Checker/CheckDeadStores.cpp
+++ b/lib/Checker/CheckDeadStores.cpp
@@ -142,7 +142,8 @@ public:
if (VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl())) {
// Special case: check for assigning null to a pointer.
// This is a common form of defensive programming.
- if (VD->getType()->isPointerType()) {
+ QualType T = VD->getType();
+ if (T->isPointerType() || T->isObjCObjectPointerType()) {
if (B->getRHS()->isNullPointerConstant(Ctx,
Expr::NPC_ValueDependentIsNull))
return;
OpenPOWER on IntegriCloud