summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/ScopeInfo.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-11-21 21:12:11 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-11-21 21:12:11 +0000
commitac1c5120c6b57d37299720c98a76dcbcea3e640c (patch)
tree7ce65ab4318f3ad9b30c3f3f383a8de49c44f155 /clang/lib/Sema/ScopeInfo.cpp
parent6f3150a7d2626ebfcffdef01d91f86daaffc662b (diff)
downloadbcm5719-llvm-ac1c5120c6b57d37299720c98a76dcbcea3e640c.tar.gz
bcm5719-llvm-ac1c5120c6b57d37299720c98a76dcbcea3e640c.zip
Objective-C ARC. Fixes a crash when checking for 'weak' propery
whose base is not an expression. rdar://19053620 llvm-svn: 222570
Diffstat (limited to 'clang/lib/Sema/ScopeInfo.cpp')
-rw-r--r--clang/lib/Sema/ScopeInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/ScopeInfo.cpp b/clang/lib/Sema/ScopeInfo.cpp
index 00d9982ac06..63ef3b2355f 100644
--- a/clang/lib/Sema/ScopeInfo.cpp
+++ b/clang/lib/Sema/ScopeInfo.cpp
@@ -176,6 +176,8 @@ void FunctionScopeInfo::markSafeWeakUse(const Expr *E) {
// Has this weak object been seen before?
FunctionScopeInfo::WeakObjectUseMap::iterator Uses;
if (const ObjCPropertyRefExpr *RefExpr = dyn_cast<ObjCPropertyRefExpr>(E)) {
+ if (!RefExpr->isObjectReceiver())
+ return;
if (isa<OpaqueValueExpr>(RefExpr->getBase()))
Uses = WeakObjectUses.find(WeakObjectProfileTy(RefExpr));
else {
OpenPOWER on IntegriCloud