diff --git a/libcxxabi/test/forced_unwind1.pass.cpp b/libcxxabi/test/forced_unwind1.pass.cpp --- a/libcxxabi/test/forced_unwind1.pass.cpp +++ b/libcxxabi/test/forced_unwind1.pass.cpp @@ -53,7 +53,7 @@ static void forced_unwind() { _Unwind_Exception* exc = new _Unwind_Exception; - exc->exception_class = 0; + memset(&exc->exception_class, 0, sizeof(exc->exception_class)); exc->exception_cleanup = cleanup; _Unwind_ForcedUnwind(exc, Stop<_Unwind_Stop_Fn>::stop, 0); abort(); diff --git a/libcxxabi/test/forced_unwind2.pass.cpp b/libcxxabi/test/forced_unwind2.pass.cpp --- a/libcxxabi/test/forced_unwind2.pass.cpp +++ b/libcxxabi/test/forced_unwind2.pass.cpp @@ -41,7 +41,7 @@ static void forced_unwind() { _Unwind_Exception* exc = new _Unwind_Exception; - exc->exception_class = 0; + memset(&exc->exception_class, 0, sizeof(exc->exception_class)); exc->exception_cleanup = 0; _Unwind_ForcedUnwind(exc, Stop<_Unwind_Stop_Fn>::stop, 0); abort(); diff --git a/libunwind/include/unwind.h b/libunwind/include/unwind.h --- a/libunwind/include/unwind.h +++ b/libunwind/include/unwind.h @@ -64,7 +64,7 @@ typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int version, _Unwind_Action actions, - uint64_t exceptionClass, + _Unwind_Exception_Class exceptionClass, _Unwind_Exception* exceptionObject, struct _Unwind_Context* context, void* stop_parameter); diff --git a/libunwind/include/unwind_arm_ehabi.h b/libunwind/include/unwind_arm_ehabi.h --- a/libunwind/include/unwind_arm_ehabi.h +++ b/libunwind/include/unwind_arm_ehabi.h @@ -27,9 +27,10 @@ struct _Unwind_Control_Block; typedef struct _Unwind_Control_Block _Unwind_Control_Block; #define _Unwind_Exception _Unwind_Control_Block /* Alias */ +typedef uint8_t _Unwind_Exception_Class[8]; struct _Unwind_Control_Block { - uint64_t exception_class; + _Unwind_Exception_Class exception_class; void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block*); /* Unwinder cache, private fields for the unwinder's use */ diff --git a/libunwind/include/unwind_itanium.h b/libunwind/include/unwind_itanium.h --- a/libunwind/include/unwind_itanium.h +++ b/libunwind/include/unwind_itanium.h @@ -16,9 +16,10 @@ struct _Unwind_Context; // opaque struct _Unwind_Exception; // forward declaration typedef struct _Unwind_Exception _Unwind_Exception; +typedef uint64_t _Unwind_Exception_Class; struct _Unwind_Exception { - uint64_t exception_class; + _Unwind_Exception_Class exception_class; void (*exception_cleanup)(_Unwind_Reason_Code reason, _Unwind_Exception *exc); #if defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__) diff --git a/libunwind/src/UnwindLevel1-gcc-ext.c b/libunwind/src/UnwindLevel1-gcc-ext.c --- a/libunwind/src/UnwindLevel1-gcc-ext.c +++ b/libunwind/src/UnwindLevel1-gcc-ext.c @@ -109,7 +109,7 @@ // Create a mock exception object for force unwinding. _Unwind_Exception ex; memset(&ex, '\0', sizeof(ex)); - ex.exception_class = 0x434C4E47554E5700; // CLNGUNW\0 + strcpy(&ex.exception_class, "CLNGUNW"); #endif // walk each frame diff --git a/libunwind/test/forceunwind.pass.cpp b/libunwind/test/forceunwind.pass.cpp --- a/libunwind/test/forceunwind.pass.cpp +++ b/libunwind/test/forceunwind.pass.cpp @@ -27,7 +27,7 @@ _Unwind_Exception ex; _Unwind_Reason_Code stop(int version, _Unwind_Action actions, - uint64_t exceptionClass, + _Unwind_Exception_Class exceptionClass, _Unwind_Exception *exceptionObject, struct _Unwind_Context *context, void *stop_parameter) { @@ -57,7 +57,7 @@ #if defined(_LIBUNWIND_ARM_EHABI) // Create a mock exception object. memset(e, '\0', sizeof(*e)); - e->exception_class = 0x434C4E47554E5700; // CLNGUNW\0 + strcpy(reinterpret_cast(&e->exception_class), "CLNGUNW"); #endif _Unwind_ForcedUnwind(e, stop, (void *)&foo); }