Return the address of the current instruction in EmitSynchronization

This commit is contained in:
svc64 2023-09-23 17:17:13 +03:00
parent fc361f82a7
commit 841aa89581

View file

@ -498,7 +498,7 @@ namespace ARMeilleure.Translation
context.MarkLabel(lblEnd); context.MarkLabel(lblEnd);
} }
internal static void EmitSynchronization(EmitterContext context) internal static void EmitSynchronization(ArmEmitterContext context)
{ {
long countOffs = NativeContext.GetCounterOffset(); long countOffs = NativeContext.GetCounterOffset();
@ -512,7 +512,8 @@ namespace ARMeilleure.Translation
Operand running = context.Call(typeof(NativeInterface).GetMethod(nameof(NativeInterface.CheckSynchronization))); Operand running = context.Call(typeof(NativeInterface).GetMethod(nameof(NativeInterface.CheckSynchronization)));
context.BranchIfTrue(lblExit, running, BasicBlockFrequency.Cold); 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); context.MarkLabel(lblNonZero);
count = context.Subtract(count, Const(1)); count = context.Subtract(count, Const(1));