From 94f7f52dac5fbc3b1abe7f38cabf38853b7af0f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20Storsj=C3=B6?= Date: Tue, 7 Jun 2022 14:12:46 +0300 Subject: [PATCH] ntdll: Take ControlPcIsUnwound into account on arm64 too. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This is the same modification as the previous patch, applied on arm64. It doesn't change the outcome for any of my tests though. Signed-off-by: Martin Storsjö --- dlls/ntdll/signal_arm64.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/signal_arm64.c b/dlls/ntdll/signal_arm64.c index 034c78f6b4d..fba0da48a16 100644 --- a/dlls/ntdll/signal_arm64.c +++ b/dlls/ntdll/signal_arm64.c @@ -165,6 +165,7 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX { LDR_DATA_TABLE_ENTRY *module; NTSTATUS status; + DWORD64 pc; dispatch->ImageBase = 0; dispatch->ScopeIndex = 0; @@ -175,14 +176,14 @@ static NTSTATUS virtual_unwind( ULONG type, DISPATCHER_CONTEXT *dispatch, CONTEX * signal frame. */ dispatch->ControlPcIsUnwound = (context->ContextFlags & CONTEXT_UNWOUND_TO_CALL) != 0; + pc = context->Pc - (dispatch->ControlPcIsUnwound ? 4 : 0); /* first look for PE exception information */ - if ((dispatch->FunctionEntry = lookup_function_info( - context->Pc - (dispatch->ControlPcIsUnwound ? 4 : 0), + if ((dispatch->FunctionEntry = lookup_function_info(pc, &dispatch->ImageBase, &module ))) { - dispatch->LanguageHandler = RtlVirtualUnwind( type, dispatch->ImageBase, context->Pc, + dispatch->LanguageHandler = RtlVirtualUnwind( type, dispatch->ImageBase, pc, dispatch->FunctionEntry, context, &dispatch->HandlerData, &dispatch->EstablisherFrame, NULL ); -- 2.11.4.GIT