summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/libsupc++
diff options
context:
space:
mode:
authorroland <roland@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-12 22:42:13 +0000
committerroland <roland@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-12 22:42:13 +0000
commita9a576ffd7ff2b05405260677758e88422312c97 (patch)
tree73c30d6cc6e91c9877a5f5f9892de92f4c43bdee /libstdc++-v3/libsupc++
parentbbce8ac0cb0d29255906addcb2892a7dc895656f (diff)
downloadppe42-gcc-a9a576ffd7ff2b05405260677758e88422312c97.tar.gz
ppe42-gcc-a9a576ffd7ff2b05405260677758e88422312c97.zip
PR libstdc++/59392: Fix ARM EABI uncaught throw from unexpected exception handler
libstdc++-v3/ PR libstdc++/59392 * libsupc++/eh_call.cc (__cxa_call_unexpected): Call __do_catch with the address of a null pointer, not with a null pointer to pointer. Copy comment for this case from eh_personality.cc:__cxa_call_unexpected. * testsuite/18_support/bad_exception/59392.cc: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208519 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r--libstdc++-v3/libsupc++/eh_call.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/libstdc++-v3/libsupc++/eh_call.cc b/libstdc++-v3/libsupc++/eh_call.cc
index dc32dd392e8..76776927aee 100644
--- a/libstdc++-v3/libsupc++/eh_call.cc
+++ b/libstdc++-v3/libsupc++/eh_call.cc
@@ -104,14 +104,14 @@ __cxa_call_unexpected(void* exc_obj_in)
} end_catch_protect_obj;
- __try
- {
+ __try
+ {
if (foreign_exception)
std::unexpected();
else
__unexpected(unexpectedHandler);
}
- __catch(...)
+ __catch(...)
{
/* See if the new exception matches the rtti list. */
if (foreign_exception)
@@ -140,15 +140,19 @@ __cxa_call_unexpected(void* exc_obj_in)
&new_ptr) != ctm_failed)
__throw_exception_again;
- if (catch_type->__do_catch(&bad_exc, 0, 1))
+ // If the exception spec allows std::bad_exception, throw that.
+ // We don't have a thrown object to compare against, but since
+ // bad_exception doesn't have virtual bases, that's OK; just pass NULL.
+ void* obj = NULL;
+ if (catch_type->__do_catch(&bad_exc, &obj, 1))
bad_exception_allowed = true;
}
// If the exception spec allows std::bad_exception, throw that.
-#ifdef __EXCEPTIONS
+#ifdef __EXCEPTIONS
if (bad_exception_allowed)
throw std::bad_exception();
-#endif
+#endif
// Otherwise, die.
__terminate(terminateHandler);
OpenPOWER on IntegriCloud