summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2013-09-17 01:30:57 +0000
committerAnna Zaks <ganna@apple.com>2013-09-17 01:30:57 +0000
commit226a56fa1dde6363cc6e246ddc1dda99517e609e (patch)
tree8e02b8fffc8b256fbf802fc07e1b71ea735b74ad /clang/lib/StaticAnalyzer/Core/CallEvent.cpp
parentfb05094b526217ff2c7702d9236d69a3fbe268fc (diff)
downloadbcm5719-llvm-226a56fa1dde6363cc6e246ddc1dda99517e609e.tar.gz
bcm5719-llvm-226a56fa1dde6363cc6e246ddc1dda99517e609e.zip
[analyzer] More reliably detect property accessors.
This has a side effect of preventing a crash, which occurs because we get a property getter declaration, which is overriding but is declared inside @protocol. Will file a bug about this inconsistency internally. Getting a small test case is very challenging. llvm-svn: 190836
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CallEvent.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CallEvent.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index 59cdfbb7f9e..4f8683f7853 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -685,8 +685,14 @@ const PseudoObjectExpr *ObjCMethodCall::getContainingPseudoObjectExpr() const {
ObjCMessageKind ObjCMethodCall::getMessageKind() const {
if (Data == 0) {
+
+ // Find the parent, ignoring implicit casts.
ParentMap &PM = getLocationContext()->getParentMap();
const Stmt *S = PM.getParent(getOriginExpr());
+ while (isa<ImplicitCastExpr>(S))
+ S = PM.getParent(S);
+
+ // Check if parent is a PseudoObjectExpr.
if (const PseudoObjectExpr *POE = dyn_cast_or_null<PseudoObjectExpr>(S)) {
const Expr *Syntactic = POE->getSyntacticForm();
OpenPOWER on IntegriCloud