aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-09-25 00:00:20 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-09-25 00:00:20 +0000
commit76368e843cdf7db9c0d534384bf7a114fa260ffc (patch)
tree365d64e7f5a0774490bf14846386c3a459fdb7a2 /lib/CodeGen/CGExpr.cpp
parent8fdccd95fcc98956cddd9f10b4d72b0c01bf3eac (diff)
Fixed another code gen bug in objc's new write-barrier API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 332d47c1dd..af8363dbb1 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -494,11 +494,12 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src, LValue Dst,
assert(Dst.getBaseIvarExp() && "BaseIvarExp is NULL");
const llvm::Type *ResultType = ConvertType(getContext().LongTy);
llvm::Value *RHS = EmitScalarExpr(Dst.getBaseIvarExp());
+ llvm::Value *dst = RHS;
RHS = Builder.CreatePtrToInt(RHS, ResultType, "sub.ptr.rhs.cast");
llvm::Value *LHS =
Builder.CreatePtrToInt(LvalueDst, ResultType, "sub.ptr.lhs.cast");
llvm::Value *BytesBetween = Builder.CreateSub(LHS, RHS, "ivar.offset");
- CGM.getObjCRuntime().EmitObjCIvarAssign(*this, src, LvalueDst,
+ CGM.getObjCRuntime().EmitObjCIvarAssign(*this, src, dst,
BytesBetween);
}
else if (Dst.isGlobalObjCRef())