summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/exception.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/exception.cc b/src/exception.cc
index e0d32da..bdf42a8 100644
--- a/src/exception.cc
+++ b/src/exception.cc
@@ -904,10 +904,10 @@ extern "C" void __cxa_call_unexpected(void*exception)
/**
* ABI function, returns the adjusted pointer to the exception object.
*/
-extern "C" void *__cxa_get_exception_ptr(void *exceptionObject) {
- // exceptionObject is the pointer to the _Unwind_Exception within the
- // __cxa_exception. The throw object is after this
- return ((char*)exceptionObject + sizeof(_Unwind_Exception));
+extern "C" void *__cxa_get_exception_ptr(void *exceptionObject)
+{
+ return ((__cxa_exception*)((char*)exceptionObject -
+ offsetof(struct __cxa_exception, unwindHeader)))->adjustedPtr;
}