[PATCH] D34331: func.wrap.func.con: Unset function before destroying anything

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 18 11:52:40 PDT 2017


dexonsmith created this revision.

Be defensive against a reentrant std::function::operator=(), in case the held function object has a non-trivial destructor.  Destroying the function object in-place can lead to the destructor being called twice.

rdar://problem/32836603


https://reviews.llvm.org/D34331

Files:
  libcxx/include/functional
  libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/move_reentrant.pass.cpp
  libcxx/test/libcxx/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign_reentrant.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34331.102974.patch
Type: text/x-patch
Size: 3590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170618/95e69ecc/attachment.bin>


More information about the cfe-commits mailing list