summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranonymous <local@localhost>2011-01-11 17:21:43 +0600
committeranonymous <local@localhost>2011-01-11 17:21:43 +0600
commitcbb9a469a4927a0c9c1a089127a75b4ea3096744 (patch)
treed7e1b098ee537992320e747a07ef320cbdc6eecc
parent602a98f34de65587005ac2a52c3e10ce51830d79 (diff)
downloadlibcxxrt-cbb9a469a4927a0c9c1a089127a75b4ea3096744.tar.gz
libcxxrt-cbb9a469a4927a0c9c1a089127a75b4ea3096744.tar.bz2
libcxxrt-cbb9a469a4927a0c9c1a089127a75b4ea3096744.tar.xz
fix for crash in report_failure function
-rw-r--r--src/exception.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/exception.cc b/src/exception.cc
index bc4cd02..686dba2 100644
--- a/src/exception.cc
+++ b/src/exception.cc
@@ -436,7 +436,7 @@ static _Unwind_Reason_Code trace(struct _Unwind_Context *context, void *c)
* If the failure happened by falling off the end of the stack without finding
* a handler, prints a back trace before aborting.
*/
-static void report_failure(_Unwind_Reason_Code err, void *thrown_exception)
+static void report_failure(_Unwind_Reason_Code err, __cxa_exception *thrown_exception)
{
switch (err)
{
@@ -453,7 +453,7 @@ static void report_failure(_Unwind_Reason_Code err, void *thrown_exception)
size_t bufferSize = 128;
char *demangled = (char*)malloc(bufferSize);
- const char *mangled = __cxa_current_exception_type()->name();
+ const char *mangled = thrown_exception->exceptionType->name();
int status;
__cxa_demangle(mangled, demangled, &bufferSize, &status);
fprintf(stderr, " of type %s\n",
@@ -493,7 +493,7 @@ extern "C" void __cxa_throw(void *thrown_exception,
info->globals.uncaughtExceptions++;
_Unwind_Reason_Code err = _Unwind_RaiseException(&ex->unwindHeader);
- report_failure(err, thrown_exception);
+ report_failure(err, ex);
}
@@ -536,7 +536,7 @@ extern "C" void __cxa_rethrow()
// will then run cleanup code and bounce the exception back with
// _Unwind_Resume().
_Unwind_Reason_Code err = _Unwind_Resume_or_Rethrow(&ex->unwindHeader);
- report_failure(err, ex + 1);
+ report_failure(err, ex);
}
/**