[Bug libstdc++/85812] [7/8 Regression] make_exception_ptr can leak the allocated exception if construction throws
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu May 17 16:10:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85812
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Thu May 17 16:10:20 2018
New Revision: 260327
URL: https://gcc.gnu.org/viewcvs?rev=260327&root=gcc&view=rev
Log:
PR libstdc++/85812 fix memory leak in std::make_exception_ptr
PR libstdc++/85812
* libsupc++/cxxabi_init_exception.h (__cxa_free_exception): Declare.
* libsupc++/exception_ptr.h (make_exception_ptr) [__cpp_exceptions]:
Refactor to separate non-throwing and throwing implementations.
[__cpp_rtti && !_GLIBCXX_HAVE_CDTOR_CALLABI]: Deallocate the memory
if constructing the object throws.
Modified:
branches/gcc-8-branch/libstdc++-v3/ChangeLog
branches/gcc-8-branch/libstdc++-v3/libsupc++/cxxabi_init_exception.h
branches/gcc-8-branch/libstdc++-v3/libsupc++/exception_ptr.h
More information about the Gcc-bugs
mailing list