Module: wine Branch: master Commit: 23b44e8df62847872d036cd88d72e36b5424ee35 URL: https://source.winehq.org/git/wine.git/?a=commit;h=23b44e8df62847872d036cd88... Author: Martin Storsjo <martin(a)martin.st> Date: Sun Jul 25 23:33:05 2021 +0300 ntdll: Fix arm64 call_user_exception_dispatcher with kernel stack for syscalls. Don't call KiUserExceptionDispatcher directly on the stack pointer stored in the CONTEXT, but use the one stored in syscall_frame (which includes the stack allocation in e.g. RtlRaiseException). This fixes unwinding test cases that worked before 08c4419a49655801cba2b71ea327534ff7fd4278. Signed-off-by: Martin Storsjo <martin(a)martin.st> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/signal_arm64.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index 1e4f493bc97..0ce6206aa9d 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -705,12 +705,18 @@ void call_raise_user_exception_dispatcher(void) NTSTATUS call_user_exception_dispatcher( EXCEPTION_RECORD *rec, CONTEXT *context ) { struct syscall_frame *frame = arm64_thread_data()->syscall_frame; + ULONG64 fp = frame->fp; + ULONG64 lr = frame->lr; + ULONG64 sp = frame->sp; NTSTATUS status = NtSetContextThread( GetCurrentThread(), context ); if (status) return status; frame->x[0] = (ULONG64)rec; frame->x[1] = (ULONG64)context; frame->pc = (ULONG64)pKiUserExceptionDispatcher; + frame->fp = fp; + frame->lr = lr; + frame->sp = sp; frame->restore_flags |= CONTEXT_INTEGER | CONTEXT_CONTROL; return status; }