diff options
author | Ben Cheng <bccheng@google.com> | 2014-04-22 13:33:12 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2014-04-22 13:33:12 -0700 |
commit | e3cc64dec20832769406aa38cde83c7dd4194bf4 (patch) | |
tree | ef8e39be37cfe0cb69d850043b7924389ff17164 /gcc-4.9/libstdc++-v3/libsupc++ | |
parent | f33c7b3122b1d7950efa88067c9a156229ba647b (diff) | |
download | toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.tar.gz toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.tar.bz2 toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.zip |
[4.9] GCC 4.9.0 official release refresh
Change-Id: Ic99a7da8b44b789a48aeec93b33e93944d6e6767
Diffstat (limited to 'gcc-4.9/libstdc++-v3/libsupc++')
-rw-r--r-- | gcc-4.9/libstdc++-v3/libsupc++/eh_ptr.cc | 28 | ||||
-rw-r--r-- | gcc-4.9/libstdc++-v3/libsupc++/unwind-cxx.h | 9 |
2 files changed, 35 insertions, 2 deletions
diff --git a/gcc-4.9/libstdc++-v3/libsupc++/eh_ptr.cc b/gcc-4.9/libstdc++-v3/libsupc++/eh_ptr.cc index 6508749e5..f9743095e 100644 --- a/gcc-4.9/libstdc++-v3/libsupc++/eh_ptr.cc +++ b/gcc-4.9/libstdc++-v3/libsupc++/eh_ptr.cc @@ -35,6 +35,34 @@ using namespace __cxxabiv1; +// Verify assumptions about member layout in exception types +namespace +{ +template<typename Ex> + constexpr std::size_t unwindhdr() + { return offsetof(Ex, unwindHeader); } + +template<typename Ex> + constexpr std::size_t termHandler() + { return unwindhdr<Ex>() - offsetof(Ex, terminateHandler); } + +static_assert( termHandler<__cxa_exception>() + == termHandler<__cxa_dependent_exception>(), + "__cxa_dependent_exception::termHandler layout must be" + " consistent with __cxa_exception::termHandler" ); + +#ifndef __ARM_EABI_UNWINDER__ +template<typename Ex> + constexpr std::ptrdiff_t adjptr() + { return unwindhdr<Ex>() - offsetof(Ex, adjustedPtr); } + +static_assert( adjptr<__cxa_exception>() + == adjptr<__cxa_dependent_exception>(), + "__cxa_dependent_exception::adjustedPtr layout must be" + " consistent with __cxa_exception::adjustedPtr" ); +#endif +} + std::__exception_ptr::exception_ptr::exception_ptr() _GLIBCXX_USE_NOEXCEPT : _M_exception_object(0) { } diff --git a/gcc-4.9/libstdc++-v3/libsupc++/unwind-cxx.h b/gcc-4.9/libstdc++-v3/libsupc++/unwind-cxx.h index a7df60380..f57c53637 100644 --- a/gcc-4.9/libstdc++-v3/libsupc++/unwind-cxx.h +++ b/gcc-4.9/libstdc++-v3/libsupc++/unwind-cxx.h @@ -81,7 +81,7 @@ struct __cxa_exception // Stack of exceptions in cleanups. __cxa_exception* nextPropagatingException; - // The nuber of active cleanup handlers for this exception. + // The number of active cleanup handlers for this exception. int propagationCount; #else // Cache parsed handler data from the personality routine Phase 1 @@ -114,6 +114,11 @@ struct __cxa_dependent_exception // The primary exception this thing depends on. void *primaryException; + // Unused member to get similar layout to __cxa_exception, otherwise the + // alignment requirements of _Unwind_Exception would require padding bytes + // before the unwindHeader member. + void (_GLIBCXX_CDTOR_CALLABI *__padding)(void *); + // The C++ standard has entertaining rules wrt calling set_terminate // and set_unexpected in the middle of the exception cleanup process. std::unexpected_handler unexpectedHandler; @@ -130,7 +135,7 @@ struct __cxa_dependent_exception // Stack of exceptions in cleanups. __cxa_exception* nextPropagatingException; - // The nuber of active cleanup handlers for this exception. + // The number of active cleanup handlers for this exception. int propagationCount; #else // Cache parsed handler data from the personality routine Phase 1 |