Allow EmitOpCode to be called even after everything has been emitted

This commit is contained in:
gdkchan 2018-11-30 22:41:44 -03:00
commit 508899f8bb

View file

@ -78,8 +78,6 @@ namespace ChocolArm64.Translation
{ {
if (!AdvanceBlock()) if (!AdvanceBlock())
{ {
--_opcIndex;
return false; return false;
} }
@ -148,6 +146,11 @@ namespace ChocolArm64.Translation
public void EmitOpCode() public void EmitOpCode()
{ {
if (_currBlock == null)
{
return;
}
if (_opcIndex == 0) if (_opcIndex == 0)
{ {
MarkLabel(GetLabel(_currBlock.Position)); MarkLabel(GetLabel(_currBlock.Position));