From e86befa5c02daa2fdc80539794a5208cbd5bbe28 Mon Sep 17 00:00:00 2001 From: anonymous Date: Fri, 29 Oct 2010 14:44:38 +0000 Subject: Make __cxa_get_exception_ptr() return the correct value, instead of one that is occasionally correct. --- src/exception.cc | 8 ++++---- 1 file 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; } -- cgit v1.2.3