Martin Storsjo : ntdll: Unwind to the LR register if no unwind info is available.

Alexandre Julliard julliard at winehq.org
Mon Oct 5 15:54:58 CDT 2020


Module: wine
Branch: master
Commit: df794f342500f1b4bfd988f292302afa890354c1
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=df794f342500f1b4bfd988f292302afa890354c1

Author: Martin Storsjo <martin at martin.st>
Date:   Mon Oct  5 12:16:39 2020 +0300

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 <martin at martin.st>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 eb451603fe..c9f44e92d3 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;




More information about the wine-cvs mailing list