From 430a48338b5a0531ed2e675d03f30f0409cf6588 Mon Sep 17 00:00:00 2001 From: Ficture Seven Date: Thu, 14 May 2020 08:50:35 +0400 Subject: [PATCH] Fix RET Xn translation (#1242) --- ARMeilleure/Instructions/InstEmitFlow.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ARMeilleure/Instructions/InstEmitFlow.cs b/ARMeilleure/Instructions/InstEmitFlow.cs index bac9ec588..6f2a346ec 100644 --- a/ARMeilleure/Instructions/InstEmitFlow.cs +++ b/ARMeilleure/Instructions/InstEmitFlow.cs @@ -71,7 +71,9 @@ namespace ARMeilleure.Instructions public static void Ret(ArmEmitterContext context) { - context.Return(GetIntOrZR(context, RegisterAlias.Lr)); + OpCodeBReg op = (OpCodeBReg)context.CurrOp; + + context.Return(GetIntOrZR(context, op.Rn)); } public static void Tbnz(ArmEmitterContext context) => EmitTb(context, onNotZero: true);