Explorar o código

Fix BLR when the source reg is X30 (#493)

gdkchan %!s(int64=7) %!d(string=hai) anos
pai
achega
a4822b7946
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      ChocolArm64/Instructions/InstEmitFlow.cs

+ 4 - 1
ChocolArm64/Instructions/InstEmitFlow.cs

@@ -72,11 +72,14 @@ namespace ChocolArm64.Instructions
         {
             OpCodeBReg64 op = (OpCodeBReg64)context.CurrOp;
 
+            context.EmitLdintzr(op.Rn);
+            context.EmitSttmp();
+
             context.EmitLdc_I(op.Position + 4);
             context.EmitStint(CpuThreadState.LrIndex);
             context.EmitStoreState();
-            context.EmitLdintzr(op.Rn);
 
+            context.EmitLdtmp();
             context.Emit(OpCodes.Ret);
         }