protected PatchState NeedsPatching( AVM1Code code, int instructionIndex )
{
_Machine.Reset();
if ( _Machine.Run( code, instructionIndex, _Check ) )
{
// the run completed, that's good
// check the result
CheckMachine.MachineStackEntry e = _Machine.MachineResult;
if ( e.Type == CheckMachine.MachineStackType.KeepInstruction )
return PatchState.Innocent;
else if ( e.Type == CheckMachine.MachineStackType.RemoveInstruction )
return PatchState.Change;
else
throw new Exception( "FUCKUP! Final CheckMachine State is wongobongo" );
}
else
{
return PatchState.Indeterministic;
}
}