This is an archive of the discontinued LLVM Phabricator instance.

[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
ClosedPublic

Authored by rsmith on Jul 19 2016, 12:53 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

rsmith updated this revision to Diff 64548.Jul 19 2016, 12:53 PM
rsmith retitled this revision from to [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.
rsmith updated this object.
rsmith added reviewers: EricWF, mclow.lists.
rsmith set the repository for this revision to rL LLVM.
rsmith added a subscriber: cfe-commits.
rsmith added inline comments.
src/CMakeLists.txt
94

Err, ignore this :)

EricWF accepted this revision.Jul 19 2016, 1:01 PM
EricWF edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jul 19 2016, 1:01 PM
rsmith closed this revision.Jul 19 2016, 1:27 PM

Committed as r276016.