summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprComplex.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-12-06 06:10:02 +0000
committerJohn McCall <rjmccall@apple.com>2010-12-06 06:10:02 +0000
commitd0a300162ebea20706866399c82adfe5abf6d924 (patch)
tree99caa86fad5b9565cac63158ebb1f7973b9013b0 /clang/lib/CodeGen/CGExprComplex.cpp
parent0d025b6b42111f1ebab71ea000172dfe821551b6 (diff)
downloadbcm5719-llvm-d0a300162ebea20706866399c82adfe5abf6d924.tar.gz
bcm5719-llvm-d0a300162ebea20706866399c82adfe5abf6d924.zip
__block variables require us to evaluate the RHS of an assignment before
the LHS, or else the pointer might be invalid. This is kindof dumb, but go ahead and make sure we're doing that for l-value scalar assignment, which fixes a miscompile of obj-c++.dg/block-seq.mm. Leave a FIXME for how to solve this problem for agg __blocks. llvm-svn: 120992
Diffstat (limited to 'clang/lib/CodeGen/CGExprComplex.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprComplex.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp
index 89a3a26ed61..7896504d86b 100644
--- a/clang/lib/CodeGen/CGExprComplex.cpp
+++ b/clang/lib/CodeGen/CGExprComplex.cpp
@@ -602,7 +602,7 @@ LValue ComplexExprEmitter::EmitBinAssignLValue(const BinaryOperator *E,
TestAndClearIgnoreReal();
TestAndClearIgnoreImag();
- // Emit the RHS.
+ // Emit the RHS. __block variables need the RHS evaluated first.
Val = Visit(E->getRHS());
// Compute the address to store into.
OpenPOWER on IntegriCloud