diff options
author | anonymous <local@localhost> | 2010-10-29 14:44:38 +0000 |
---|---|---|
committer | anonymous <local@localhost> | 2010-10-29 14:44:38 +0000 |
commit | e86befa5c02daa2fdc80539794a5208cbd5bbe28 (patch) | |
tree | 5eac48a4f6c8c9b444c974b9f06c7b3ca7740a89 | |
parent | e6a523d6eb2ee53a399da43b55f5b4e1bd7810ec (diff) | |
download | libcxxrt-e86befa5c02daa2fdc80539794a5208cbd5bbe28.tar.gz libcxxrt-e86befa5c02daa2fdc80539794a5208cbd5bbe28.tar.bz2 libcxxrt-e86befa5c02daa2fdc80539794a5208cbd5bbe28.tar.xz |
Make __cxa_get_exception_ptr() return the correct value, instead of one
that is occasionally correct.
-rw-r--r-- | src/exception.cc | 8 |
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; } |