summaryrefslogtreecommitdiff
path: root/lib/Bitcode/Writer
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-09-03 22:40:54 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-09-03 22:40:54 +0000
commit72196ab082c1f2132d209e61d93d084d55fb6c18 (patch)
tree4180fd0a41d5428875ac907fca5338a139f72043 /lib/Bitcode/Writer
parent08c560e782b1ea71df4627e2a910b402248786cd (diff)
downloadllvm-72196ab082c1f2132d209e61d93d084d55fb6c18.tar.gz
llvm-72196ab082c1f2132d209e61d93d084d55fb6c18.tar.bz2
llvm-72196ab082c1f2132d209e61d93d084d55fb6c18.tar.xz
[objc-arc] Turn off the objc_retainBlock -> objc_retain optimization.
The reason that I am turning off this optimization is that there is an additional case where a block can escape that has come up. Specifically, this occurs when a block is used in a scope outside of its current scope. This can cause a captured retainable object pointer whose life is preserved by the objc_retainBlock to be deallocated before the block is invoked. An example of the code needed to trigger the bug is: ---- \#import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { void (^somethingToDoLater)(); { NSObject *obj = [NSObject new]; somethingToDoLater = ^{ [obj self]; // Crashes here }; } NSLog(@"test."); somethingToDoLater(); return 0; } ---- In the next commit, I remove all the dead code that results from this. Once I put in the fixing commit I will bring back the tests that I deleted in this commit. rdar://14802782. rdar://14868830. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189869 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer')
0 files changed, 0 insertions, 0 deletions