summaryrefslogtreecommitdiff
path: root/lib/Analysis/NSAutoreleasePoolChecker.cpp
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2009-12-01 11:08:04 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2009-12-01 11:08:04 +0000
commit1569ce68681d909594d64f9b056d71f5dd7563bf (patch)
tree867cbbe32a66fd7d62dd9ce9df23a23fefdb8290 /lib/Analysis/NSAutoreleasePoolChecker.cpp
parentf5bd02d290ff15268853e0456c130a1afa15e907 (diff)
Notes
Diffstat (limited to 'lib/Analysis/NSAutoreleasePoolChecker.cpp')
-rw-r--r--lib/Analysis/NSAutoreleasePoolChecker.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Analysis/NSAutoreleasePoolChecker.cpp b/lib/Analysis/NSAutoreleasePoolChecker.cpp
index e0a8d0dc5f73d..2ff04878f7ab2 100644
--- a/lib/Analysis/NSAutoreleasePoolChecker.cpp
+++ b/lib/Analysis/NSAutoreleasePoolChecker.cpp
@@ -19,14 +19,13 @@
#include "clang/Analysis/PathSensitive/GRExprEngine.h"
#include "clang/Analysis/PathSensitive/CheckerVisitor.h"
#include "BasicObjCFoundationChecks.h"
-#include "llvm/Support/Compiler.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Decl.h"
using namespace clang;
namespace {
-class VISIBILITY_HIDDEN NSAutoreleasePoolChecker
+class NSAutoreleasePoolChecker
: public CheckerVisitor<NSAutoreleasePoolChecker> {
Selector releaseS;
@@ -65,6 +64,9 @@ NSAutoreleasePoolChecker::PreVisitObjCMessageExpr(CheckerContext &C,
// the type of the expression.
const ObjCObjectPointerType* PT =
receiver->getType()->getAs<ObjCObjectPointerType>();
+
+ if (!PT)
+ return;
const ObjCInterfaceDecl* OD = PT->getInterfaceDecl();
if (!OD)
return;