aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-04-12 21:47:05 +0000
committerTed Kremenek <kremenek@apple.com>2011-04-12 21:47:05 +0000
commit9281efe614741f3742ebf8196a703f6c923c6ff0 (patch)
tree1d6bb61c63f3ad81c5e8abd257b4b8ce45a5639e /lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
parent1212f807af8aa93689845d18eb5a260718c77e57 (diff)
Teach VariadicMethodTypeChecker to not crash when processing methods declared in protocols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
index 60c437c1e6..2790a19c61 100644
--- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
+++ b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
@@ -503,7 +503,8 @@ public:
bool
VariadicMethodTypeChecker::isVariadicMessage(const ObjCMessage &msg) const {
const ObjCMethodDecl *MD = msg.getMethodDecl();
- if (!MD || !MD->isVariadic())
+
+ if (!MD || !MD->isVariadic() || isa<ObjCProtocolDecl>(MD->getDeclContext()))
return false;
Selector S = msg.getSelector();