diff options
author | John McCall <rjmccall@apple.com> | 2011-07-28 07:23:35 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-07-28 07:23:35 +0000 |
commit | b726a5572993e2b12442a6eed7337a311b7ebc28 (patch) | |
tree | 3b6821dd460630a23e300f2c7529730893b42f91 /clang/lib/CodeGen/CGDecl.cpp | |
parent | 3255d1d25fb3324b3be6b8612e60eb59f96aaa4c (diff) | |
download | bcm5719-llvm-b726a5572993e2b12442a6eed7337a311b7ebc28.tar.gz bcm5719-llvm-b726a5572993e2b12442a6eed7337a311b7ebc28.zip |
Fix a couple of problems with initialization and assignment to
__block variables where the act of initialization/assignment
itself causes the __block variable to be copied to the heap
because the variable is of block type and is being assigned
a block literal which captures the variable.
rdar://problem/9814099
llvm-svn: 136337
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index a372d7d6964..870fe811f14 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -507,7 +507,7 @@ void CodeGenFunction::EmitScalarInit(const Expr *init, // actually perform the initialization with an assign. bool accessedByInit = false; if (lifetime != Qualifiers::OCL_ExplicitNone) - accessedByInit = isAccessedBy(D, init); + accessedByInit = (capturedByInit || isAccessedBy(D, init)); if (accessedByInit) { LValue tempLV = lvalue; // Drill down to the __block object if necessary. |