aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-04-01 19:19:28 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-04-01 19:19:28 +0000
commit380ee502b1d91615a753dc490e1e8f83306500b6 (patch)
tree943ec07c36d73862e0347af1caf1319b0608c3c8
parentae503df62bde42440a9c4495d26d6142c4af7bcb (diff)
ANother rewrite bug, rewriting a call of
__byref block. // rdar://9204669 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128726 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Rewrite/RewriteObjC.cpp3
-rw-r--r--test/Rewriter/rewrite-block-pointer.mm1
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp
index 54d6fbb236..88703e1917 100644
--- a/lib/Rewrite/RewriteObjC.cpp
+++ b/lib/Rewrite/RewriteObjC.cpp
@@ -4795,7 +4795,8 @@ Stmt *RewriteObjC::RewriteBlockDeclRefExpr(Expr *DeclRefExp) {
// Need parens to enforce precedence.
- ParenExpr *PE = new (Context) ParenExpr(SourceLocation(), SourceLocation(),
+ ParenExpr *PE = new (Context) ParenExpr(DeclRefExp->getExprLoc(),
+ DeclRefExp->getExprLoc(),
ME);
ReplaceStmt(DeclRefExp, PE);
return PE;
diff --git a/test/Rewriter/rewrite-block-pointer.mm b/test/Rewriter/rewrite-block-pointer.mm
index c3876e9fa0..38a1b7da28 100644
--- a/test/Rewriter/rewrite-block-pointer.mm
+++ b/test/Rewriter/rewrite-block-pointer.mm
@@ -94,5 +94,6 @@ void test9204669() {
addChangeToData = ^() {
return 'b';
};
+ addChangeToData();
}