From: André Hentschel Subject: [PATCH 2/3] ntdll: Adjust PC according to THUMB/ARM flag Message-Id: <0b10bbe7-52a2-0bd9-98aa-3d1e51743cca@dawncrow.de> Date: Wed, 27 Mar 2019 13:48:12 +0100 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46189 Signed-off-by: André Hentschel --- dlls/ntdll/signal_arm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 7478f1f826d..2ff7afa928f 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -283,9 +283,12 @@ __ASM_STDCALL_FUNC( RtlCaptureContext, 4, void DECLSPEC_HIDDEN set_cpu_context( const CONTEXT *context ); __ASM_GLOBAL_FUNC( set_cpu_context, ".arm\n\t" - "ldr r1, [r0, #0x44]\n\t" /* context->Cpsr */ - "msr CPSR_f, r1\n\t" + "ldr r2, [r0, #0x44]\n\t" /* context->Cpsr */ + "tst r2, #0x20\n\t" /* thumb? */ "ldr r1, [r0, #0x40]\n\t" /* context->Pc */ + "orrne r1, r1, #1\n\t" /* Adjust PC according to thumb */ + "biceq r1, r1, #1\n\t" /* Adjust PC according to arm */ + "msr CPSR_f, r2\n\t" "ldr lr, [r0, #0x3c]\n\t" /* context->Lr */ "ldr sp, [r0, #0x38]\n\t" /* context->Sp */ "push {r1}\n\t" -- 2.17.1