]> granicus.if.org Git - clang/commit
[Sema] Disallow returning a __block variable via a move.
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 15 Feb 2017 05:15:28 +0000 (05:15 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 15 Feb 2017 05:15:28 +0000 (05:15 +0000)
commitb558dbed967655291dbd62f527cca4f6799cd9c5
tree6a8221bddefa54b0b40eda71e60870820d83c73b
parent6a3aac4cedce8a4850eff295f2159f3b0e0d2c1d
[Sema] Disallow returning a __block variable via a move.

r274291 made changes to prefer calling a move constructor to calling a
copy constructor when returning from a function. This caused programs to
crash when a __block variable in the heap was moved out and used later.

This commit fixes the bug by disallowing moving out of __block variables
implicitly.

rdar://problem/28181080

Differential Revision: https://reviews.llvm.org/D29908

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295150 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaStmt.cpp
test/SemaObjCXX/blocks.mm