Martin Storsjo : ntdll: Trust libunwind's returned pc value on arm64.

Alexandre Julliard julliard at winehq.org
Tue Aug 18 16:34:24 CDT 2020


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

Author: Martin Storsjo <martin at martin.st>
Date:   Fri Aug 14 14:54:15 2020 +0300

ntdll: Trust libunwind's returned pc value on arm64.

Use this instead of manually copying LR to PC. With GNU libunwind,
both registers are equal after unw_step.

With the LLVM libunwind (which Apple uses), the return address isn't
reflected at all in LR, only in UNW_REG_IP.

Signed-off-by: Martin Storsjo <martin at martin.st>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/unix/signal_arm64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c
index d5ced2172a..b4fe46f25a 100644
--- a/dlls/ntdll/unix/signal_arm64.c
+++ b/dlls/ntdll/unix/signal_arm64.c
@@ -230,7 +230,7 @@ NTSTATUS CDECL unwind_builtin_dll( ULONG type, DISPATCHER_CONTEXT *dispatch, CON
     unw_get_reg( &cursor, UNW_AARCH64_X29, (unw_word_t *)&context->u.s.Fp );
     unw_get_reg( &cursor, UNW_AARCH64_X30, (unw_word_t *)&context->u.s.Lr );
     unw_get_reg( &cursor, UNW_AARCH64_SP,  (unw_word_t *)&context->Sp );
-    context->Pc = context->u.s.Lr;
+    unw_get_reg( &cursor, UNW_REG_IP,      (unw_word_t *)&context->Pc );
     context->ContextFlags |= CONTEXT_UNWOUND_TO_CALL;
 
     TRACE( "next function pc=%016lx%s\n", context->Pc, rc ? "" : " (last frame)" );




More information about the wine-cvs mailing list