aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-11-09 16:41:20 -0200
committerGitHub <noreply@github.com>2018-11-09 16:41:20 -0200
commita4822b7946cc9641f7f33d5df4a0d940a1b8c93c (patch)
tree78c4b4e45bbf586e3d79e5c5f68c4550a1107d49
parent44c1cf3fe5a3886f34251f93fbcfc3b9c8f0e164 (diff)
Fix BLR when the source reg is X30 (#493)
-rw-r--r--ChocolArm64/Instructions/InstEmitFlow.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/ChocolArm64/Instructions/InstEmitFlow.cs b/ChocolArm64/Instructions/InstEmitFlow.cs
index 7d0897cd..0e9f7cb0 100644
--- a/ChocolArm64/Instructions/InstEmitFlow.cs
+++ b/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);
}