aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-03-17 04:01:35 +0000
committerTed Kremenek <kremenek@apple.com>2011-03-17 04:01:35 +0000
commit928c415d5dde89b7c01e41f0dfa8a782cbfa8e7d (patch)
tree6fbd89e32a587bdab985f703e107c47e4013e1d5 /lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
parent613744181322b9680a4b3d59cce87d7e5e572c99 (diff)
Teach VariadicMethodTypeChecker that CF references are valid arguments to variadic Objective-C methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
index 792b720b8f..51847094da 100644
--- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
+++ b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
@@ -14,6 +14,7 @@
//===----------------------------------------------------------------------===//
#include "ClangSACheckers.h"
+#include "clang/Analysis/DomainSpecific/CocoaConventions.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
@@ -594,6 +595,10 @@ void VariadicMethodTypeChecker::checkPreObjCMessage(ObjCMessage msg,
// Ignore pointer constants.
if (isa<loc::ConcreteInt>(msg.getArgSVal(I, state)))
continue;
+
+ // Ignore CF references, which can be toll-free bridged.
+ if (cocoa::isCFObjectRef(ArgTy))
+ continue;
// Generate only one error node to use for all bug reports.
if (!errorNode.hasValue()) {