From 841aa89581b00168e8d7535f8e2d2dce246e6a06 Mon Sep 17 00:00:00 2001 From: svc64 Date: Sat, 23 Sep 2023 17:17:13 +0300 Subject: [PATCH] Return the address of the current instruction in EmitSynchronization --- src/ARMeilleure/Translation/Translator.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ARMeilleure/Translation/Translator.cs b/src/ARMeilleure/Translation/Translator.cs index 410444c78e..5e25394fae 100644 --- a/src/ARMeilleure/Translation/Translator.cs +++ b/src/ARMeilleure/Translation/Translator.cs @@ -498,7 +498,7 @@ namespace ARMeilleure.Translation context.MarkLabel(lblEnd); } - internal static void EmitSynchronization(EmitterContext context) + internal static void EmitSynchronization(ArmEmitterContext context) { long countOffs = NativeContext.GetCounterOffset(); @@ -512,7 +512,8 @@ namespace ARMeilleure.Translation Operand running = context.Call(typeof(NativeInterface).GetMethod(nameof(NativeInterface.CheckSynchronization))); context.BranchIfTrue(lblExit, running, BasicBlockFrequency.Cold); - context.Return(Const(0L)); + OpCode op = context.CurrOp; + context.Return(op != null ? Const(op.Address) : Const(0L)); context.MarkLabel(lblNonZero); count = context.Subtract(count, Const(1));