[PATCH] D22528: [libcxxabi] When catching an exception of type nullptr_t with a handler of pointer-to-member type, produce a null value of the right type

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 19 12:53:33 PDT 2016


rsmith created this revision.
rsmith added reviewers: EricWF, mclow.lists.
rsmith added a subscriber: cfe-commits.
rsmith set the repository for this revision to rL LLVM.

This fixes a bug where throwing an exception of type nullptr_t and catching it as a pointer-to-member would not guarantee to produce a null value in the catch handler. The fix is pretty simple: we statically allocate a constant null pointer-to-data-member representation and a constant null pointer-to-member-function representation, and produce the address of the relevant value as the adjusted pointer for the exception.

Repository:
  rL LLVM

https://reviews.llvm.org/D22528

Files:
  src/CMakeLists.txt
  src/private_typeinfo.cpp
  test/catch_const_pointer_nullptr.pass.cpp
  test/catch_member_pointer_nullptr.pass.cpp
  test/catch_pointer_nullptr.pass.cpp
  test/catch_reference_nullptr.pass.cpp
  test/incomplete_type.sh.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22528.64548.patch
Type: text/x-patch
Size: 9719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160719/ceb537d8/attachment.bin>


More information about the cfe-commits mailing list