aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite/RewriteObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-10-14 23:31:39 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-10-14 23:31:39 +0000
commitf2c6fa4eca6e4d3b2a005416746a47e85690f3a7 (patch)
tree5a710f8d8fc47ec287ce75ba92a1b7c7cfb7cc04 /lib/Rewrite/RewriteObjC.cpp
parent3d5aff5d3036b0ff09d114857cd2276134b3d8c9 (diff)
Rewrite bug fix rewriting a property assignment when
its RHS is an ivar. Fixes //rdar: //8541517. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteObjC.cpp')
-rw-r--r--lib/Rewrite/RewriteObjC.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp
index 8532bc7f13..4c929a246b 100644
--- a/lib/Rewrite/RewriteObjC.cpp
+++ b/lib/Rewrite/RewriteObjC.cpp
@@ -5479,6 +5479,12 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) {
// ^(NSURL *errorURL, NSError *error) { return (BOOL)1; };
SourceRange SrcRange = BinOp->getSourceRange();
Stmt *newStmt = RewriteFunctionBodyOrGlobalInitializer(BinOp->getRHS());
+ // Need to rewrite the ivar access expression if need be.
+ if (isa<ObjCIvarRefExpr>(newStmt)) {
+ bool replaced = false;
+ newStmt = RewriteObjCNestedIvarRefExpr(newStmt, replaced);
+ }
+
DisableReplaceStmt = false;
//
// Unlike the main iterator, we explicily avoid changing 'BinOp'. If