From df794f342500f1b4bfd988f292302afa890354c1 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Mon, 5 Oct 2020 12:16:39 +0300 Subject: [PATCH] ntdll: Unwind to the LR register if no unwind info is available. Try to keep the behaviour from ea9f47a767c2 of erroring out if unwinding ends up out of bounds (with pc==lr, where setting pc to lr doesn't progress the unwind), but support unwinding from functions without unwind info. Signed-off-by: Martin Storsjo Signed-off-by: Alexandre Julliard --- dlls/ntdll/signal_arm64.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index eb451603fe4..c9f44e92d30 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -197,8 +197,16 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX } else { - WARN( "exception data not found in %s\n", debugstr_w(module->BaseDllName.Buffer) ); - return STATUS_INVALID_DISPOSITION; + status = context->Pc != context->u.s.Lr ? + STATUS_SUCCESS : STATUS_INVALID_DISPOSITION; + WARN( "exception data not found in %s for %p, LR %p, status %x\n", + debugstr_w(module->BaseDllName.Buffer), (void*) context->Pc, + (void*) context->u.s.Lr, status ); + dispatch->EstablisherFrame = context->Sp; + dispatch->LanguageHandler = NULL; + context->Pc = context->u.s.Lr; + context->ContextFlags |= CONTEXT_UNWOUND_TO_CALL; + return status; } dispatch->EstablisherFrame = context->u.s.Fp;