[ObjC] Copy a block to the heap if it is passed as a variadic argument
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 24 Jun 2020 18:46:38 +0000 (11:46 -0700)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 24 Jun 2020 18:46:38 +0000 (11:46 -0700)
commitcdd6a2788caced6b377af818154138d9983dba5f
treebb60e5dcfcafccf23859542304b8619710c9c074
parent01ddb2a7b044f697a15043e47acdb93e2825809a
[ObjC] Copy a block to the heap if it is passed as a variadic argument

Call maybeExtendBlockObject in DefaultVariadicArgumentPromotion so that
the block is copied to the heap when it is passed as a variadic argument
to any calls, not only to C function calls.

rdar://problem/64201532
clang/lib/Sema/SemaExpr.cpp
clang/test/CodeGenObjC/arc-blocks.m