summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprComplex.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-09-10 01:16:55 +0000
committerJohn McCall <rjmccall@apple.com>2011-09-10 01:16:55 +0000
commitcd78e805e9c0d1a1b7ccbb67773aa51589c040f7 (patch)
tree0d46a178933812aaad4d14ba3d3449b2397061fb /clang/lib/CodeGen/CGExprComplex.cpp
parenta51d74fc35aafa7c609e950cfc6e39146a8280cb (diff)
downloadbcm5719-llvm-cd78e805e9c0d1a1b7ccbb67773aa51589c040f7.tar.gz
bcm5719-llvm-cd78e805e9c0d1a1b7ccbb67773aa51589c040f7.zip
When converting a block pointer to an Objective-C pointer type, extend
the lifetime of the block by copying it to the heap, or else we'll get a dangling reference because the code working with the non-block-typed object will not know it needs to copy. There is some danger here, e.g. with assigning a block literal to an unsafe variable, but, well, it's an unsafe variable. llvm-svn: 139451
Diffstat (limited to 'clang/lib/CodeGen/CGExprComplex.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprComplex.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp
index 90e288a4508..326fcfa15bf 100644
--- a/clang/lib/CodeGen/CGExprComplex.cpp
+++ b/clang/lib/CodeGen/CGExprComplex.cpp
@@ -414,6 +414,7 @@ ComplexPairTy ComplexExprEmitter::EmitCast(CastExpr::CastKind CK, Expr *Op,
case CK_ObjCProduceObject:
case CK_ObjCConsumeObject:
case CK_ObjCReclaimReturnedObject:
+ case CK_ObjCExtendBlockObject:
llvm_unreachable("invalid cast kind for complex value");
case CK_FloatingRealToComplex:
OpenPOWER on IntegriCloud