Module: wine Branch: master Commit: a729af0e9c0027e7f9686df7e3d85ec1ab3cfb37 URL: https://source.winehq.org/git/wine.git/?a=commit;h=a729af0e9c0027e7f9686df7e...
Author: Martin Storsjo martin@martin.st Date: Tue Aug 25 12:26:25 2020 +0300
ntdll: Set handler_data correctly in arm64 RtlVirtualUnwind.
This matches what tests show is done on actual windows, in the current testcases; in all currently tested cases, handler_data is reset to NULL when no handler is returned.
Signed-off-by: Martin Storsjo martin@martin.st Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/signal_arm64.c | 2 ++ dlls/ntdll/tests/exception.c | 4 ++++ 2 files changed, 6 insertions(+)
diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 134e40545f..5521e915a7 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -889,6 +889,8 @@ PVOID WINAPI RtlVirtualUnwind( ULONG type, ULONG_PTR base, ULONG_PTR pc,
TRACE( "type %x pc %lx sp %lx func %lx\n", type, pc, context->Sp, base + func->BeginAddress );
+ *handler_data = NULL; + if (func->u.s.Flag) handler = unwind_packed_data( base, pc, func, context, ctx_ptr ); else diff --git a/dlls/ntdll/tests/exception.c b/dlls/ntdll/tests/exception.c index dd9eb966fc..1e9047383b 100644 --- a/dlls/ntdll/tests/exception.c +++ b/dlls/ntdll/tests/exception.c @@ -4331,6 +4331,10 @@ static void call_virtual_unwind( int testnum, const struct unwind_test *test ) else { ok( handler == NULL, "%u/%u: handler %p instead of NULL\n", testnum, i, handler ); + ok( data == (test->results[i].handler < 0 ? + (void *)0xdeadbeef : NULL), + "%u/%u: handler data set to %p/%p\n", testnum, i, data, + (test->results[i].handler < 0 ? (void *)0xdeadbeef : NULL) ); }
ok( context.Pc == test->results[i].pc, "%u/%u: wrong pc %p/%p\n",