protected bool InlineLoadMethod(int patchIndex, MethodDef methodToInline, Instruction loadInstr, int instrIndex) { if (!IsReturn(methodToInline, instrIndex)) return false; int methodArgsCount = DotNetUtils.GetArgsCount(methodToInline); for (int i = 0; i < methodArgsCount; i++) block.Insert(patchIndex++, OpCodes.Pop.ToInstruction()); block.Instructions[patchIndex] = new Instr(loadInstr.Clone()); return true; }
public InstructionPatcher(int patchIndex, int afterIndex, Instruction lastInstr) { this.patchIndex = patchIndex; this.afterIndex = afterIndex; this.lastInstr = lastInstr; this.clonedInstr = new Instr(lastInstr.Clone()); }