diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-05 18:05:06 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-05 18:05:06 +0000 |
commit | 92c8568856bf24360f0a90a2161b9962263d4994 (patch) | |
tree | b5d4a2c3876171946892bf1e998ac722dc6fa8cb /lib/Rewrite/RewriteObjC.cpp | |
parent | 1f24e11769016e84ebf86ac5d97d43a7ce5dd5c1 (diff) |
Fix a block rewriter bug where copy/dispose entries in
block descriptor for outer block was missing even though
the block was importing objects into its inner blocks.
//rdar://84995992
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115644 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteObjC.cpp')
-rw-r--r-- | lib/Rewrite/RewriteObjC.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp index c085e6d017..abd46df831 100644 --- a/lib/Rewrite/RewriteObjC.cpp +++ b/lib/Rewrite/RewriteObjC.cpp @@ -4381,6 +4381,12 @@ void RewriteObjC::SynthesizeBlockLiterals(SourceLocation FunLocStart, BlockByRefDeclsPtrSet.insert(VD); BlockByRefDecls.push_back(VD); } + // imported objects in the inner blocks not used in the outer + // blocks must be copied/disposed in the outer block as well. + if (Exp->isByRef() || + VD->getType()->isObjCObjectPointerType() || + VD->getType()->isBlockPointerType()) + ImportedBlockDecls.insert(VD); } std::string ImplTag = "__" + FunName.str() + "_block_impl_" + utostr(i); |