Emit the copy and dipose helpers for ARC __strong
block-typed __block variables using objc_retainBlock and objc_dispose. Previously we were using _Block_object_assign and _Block_object_destroy with BLOCK_BYREF_CALLER, which causes the runtime to completely ignore the retain and release. In most cases this doesn't cause catastrophe because the retain/release are balanced and because the block in the variable was copied upon assignment there. However, the stack copy of the variable will be released when it goes out of scope, which is a problem if that value was released due to an assignment to the heap copy. Similarly, a leak can occur if the variable is assigned after the copy to the heap. llvm-svn: 144162
Loading
Please register or sign in to comment