aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-03-28 16:23:34 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-03-28 16:23:34 +0000
commitb460210fe0dec08971edfe33c294323cf79cb894 (patch)
tree945e7e4c3bca4c33f1df0719434b8363263d16bb /lib/Sema/SemaExprObjC.cpp
parent7f3ad231bed2184694e407772689e8903068bdca (diff)
Also 'self' in blocks need be handled specially.
// rdar://9181463 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128410 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r--lib/Sema/SemaExprObjC.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 22a1b19921..cf38225de0 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -325,7 +325,10 @@ bool Sema::CheckMessageArgumentTypes(Expr **Args, unsigned NumArgs,
bool Sema::isSelfExpr(Expr *RExpr) {
// 'self' is objc 'self' in an objc method only.
- if (!isa<ObjCMethodDecl>(CurContext))
+ DeclContext *DC = CurContext;
+ while (isa<BlockDecl>(DC))
+ DC = DC->getParent();
+ if (DC && !isa<ObjCMethodDecl>(DC))
return false;
if (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(RExpr))
if (ICE->getCastKind() == CK_LValueToRValue)