Skip to content

Commit 27b7d0e

Browse files
committed
[libunwind] [SEH] Set NonVolatileRegisters before calling a personality function
The CRT __C_specific_handler function uses this for restoring registers before calling the filter function. This fixes the libunwind/libcxxabi forced unwind testcases on ARM and AArch64.
1 parent 08f0aa4 commit 27b7d0e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libunwind/src/Unwind-seh.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ __libunwind_seh_personality(int version, _Unwind_Action state,
212212
ms_exc.ExceptionInformation[2] = state;
213213
DISPATCHER_CONTEXT *disp_ctx =
214214
__unw_seh_get_disp_ctx((unw_cursor_t *)context);
215+
#if defined(__aarch64__)
216+
disp_ctx->NonVolatileRegisters = (PBYTE)&disp_ctx->ContextRecord->X19;
217+
#elif defined(__arm__)
218+
disp_ctx->NonVolatileRegisters = (PBYTE)&disp_ctx->ContextRecord->R4;
219+
#endif
215220
_LIBUNWIND_TRACE_UNWINDING("__libunwind_seh_personality() calling "
216221
"LanguageHandler %p(%p, %p, %p, %p)",
217222
(void *)disp_ctx->LanguageHandler, (void *)&ms_exc,

0 commit comments

Comments
 (0)