summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2019-11-21 18:13:48 -0800
committerArtem Dergachev <artem.dergachev@gmail.com>2019-11-21 18:59:46 -0800
commit0b58b80edb81bf8fb401f8a6e057ca9d50abc0f7 (patch)
treea2e79021a8294111d549edbeac9a630d79794b4a /clang/lib/StaticAnalyzer/Core/CallEvent.cpp
parentbbc8662db1548f98b1c475cadf6260f9079c11ea (diff)
downloadbcm5719-llvm-0b58b80edb81bf8fb401f8a6e057ca9d50abc0f7.tar.gz
bcm5719-llvm-0b58b80edb81bf8fb401f8a6e057ca9d50abc0f7.zip
[analyzer] Fix Objective-C accessor body farms after 2073dd2d.
Fix a canonicalization problem for the newly added property accessor stubs that was causing a wrong decl to be used for 'self' in the accessor's body farm. Fix a crash when constructing a body farm for accessors of a property that is declared and @synthesize'd in different (but related) interfaces. Differential Revision: https://reviews.llvm.org/D70158
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CallEvent.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CallEvent.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
index e7408b805fa..b89bbe3f54c 100644
--- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -1309,6 +1309,8 @@ RuntimeDefinition ObjCMethodCall::getRuntimeDefinition() const {
}
const ObjCMethodDecl *MD = Val.getValue();
+ if (MD && !MD->hasBody())
+ MD = MD->getCanonicalDecl();
if (CanBeSubClassed)
return RuntimeDefinition(MD, Receiver);
else
OpenPOWER on IntegriCloud