]> granicus.if.org Git - clang/commit
When converting a block pointer to an Objective-C pointer type, extend
authorJohn McCall <rjmccall@apple.com>
Sat, 10 Sep 2011 01:16:55 +0000 (01:16 +0000)
committerJohn McCall <rjmccall@apple.com>
Sat, 10 Sep 2011 01:16:55 +0000 (01:16 +0000)
commitdc05b11c67331016473fbc7909827b1b89c9616b
tree65c8e307e0ccdcb67ebba0c530f476d59f87c09f
parentb3321093f6ead084427eb4a6621832fc4ee2f5de
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139451 91177308-0d34-0410-b5e6-96231b3b80d8
15 files changed:
include/clang/AST/OperationKinds.h
include/clang/Sema/Sema.h
lib/AST/Expr.cpp
lib/AST/ExprConstant.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CGExprAgg.cpp
lib/CodeGen/CGExprComplex.cpp
lib/CodeGen/CGExprConstant.cpp
lib/CodeGen/CGExprScalar.cpp
lib/CodeGen/CGObjC.cpp
lib/Sema/SemaCXXCast.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprCXX.cpp
lib/StaticAnalyzer/Core/ExprEngineC.cpp
test/CodeGenObjC/arc.m