private void AddJumpBack(OpCode jumpOp, string jumpLabel) { // pop the most recently-added jump with the label JumpPatch jump = mJumpBackPatches.Last(j => j.Label == jumpLabel); mJumpBackPatches.Remove(jump); mBytecode.Write(jumpOp, jump.Location); }
public void PatchJump(string jumpLabel) { // pop the most recently-added jump with the label JumpPatch jump = mJumpPatches.Last(j => j.Label == jumpLabel); mJumpPatches.Remove(jump); int position = jump.Location; int destination = (int)mBytecode.Position; mBytecode.SeekTo(position); mBytecode.Write(destination); mBytecode.SeekToEnd(); }