You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
The `reinterpret_cast` to rvalue-ref triggered copy-construction under libc++, since `std::exception_ptr` has no move-constructor. This showed up as leaks reported by leak-sanitizer when using libc++. Since libstdc++ implements a separate move-constructor, it was unaffected.
Originally landed as: {D74203904}.
Reverted in: {D74256636}.
There was another problem, where, under recent libc++ versions with `__cxa_init_primary_exception`, the code-path did not set the refcount. Whereas under prior libc++ versions, the code-path did set the refcount. So the original version of the diff fixed one leak under prior libc++ while adding a leak or a use-after-free under recent libc++. It would be a leak if no further increments or decrements were done on the refcount because no copies of the `exception_ptr` are made and the `exception_ptr` is not rethrown, but a use-after-free if the `exception_ptr` is copied or rethrown.
Reviewed By: snarkmaster
Differential Revision: D74269462
fbshipit-source-id: 7cc21581be88b4cbe26ee936d96807666249188a
0 commit comments