Call objc_retainBlock before passing a block as a variadic argument
authorAkira Hatanaka <ahatanaka@apple.com>
Thu, 12 Dec 2019 06:51:18 +0000 (22:51 -0800)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 13 Dec 2019 21:10:07 +0000 (13:10 -0800)
commita0a670614a36f1686c5086033bef85800128cf66
tree2cb48ba8b13971558a1c3aef8fba2e802f51943a
parent5623bd52acd34db2e9cfc11d1510407610a14db0
Call objc_retainBlock before passing a block as a variadic argument

Copy the block to the heap before passing it to the callee in case the
block escapes in the callee.

rdar://problem/55683462

Differential Revision: https://reviews.llvm.org/D71431
clang/docs/AutomaticReferenceCounting.rst
clang/lib/Sema/SemaExpr.cpp
clang/test/CodeGenObjC/arc-blocks.m