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

This commit is contained in:
gdkchan 2018-11-09 16:41:20 -02:00 committed by GitHub
parent ecf67bdcef
commit a56f7e8f68
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}