From 508899f8bb1a3ae7b5182637c31612c49bebb8cd Mon Sep 17 00:00:00 2001 From: gdkchan Date: Fri, 30 Nov 2018 22:41:44 -0300 Subject: [PATCH] Allow EmitOpCode to be called even after everything has been emitted --- ChocolArm64/Translation/ILEmitterCtx.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ChocolArm64/Translation/ILEmitterCtx.cs b/ChocolArm64/Translation/ILEmitterCtx.cs index 19a5ee3d7b..8cc0e4b2ae 100644 --- a/ChocolArm64/Translation/ILEmitterCtx.cs +++ b/ChocolArm64/Translation/ILEmitterCtx.cs @@ -78,8 +78,6 @@ namespace ChocolArm64.Translation { if (!AdvanceBlock()) { - --_opcIndex; - return false; } @@ -148,6 +146,11 @@ namespace ChocolArm64.Translation public void EmitOpCode() { + if (_currBlock == null) + { + return; + } + if (_opcIndex == 0) { MarkLabel(GetLabel(_currBlock.Position));