Add MethodCallInliner::GetFirstInstruction()

This commit is contained in:
de4dot 2013-10-12 01:00:50 +02:00
parent 43e441ca93
commit 478595708b

View File

@ -55,6 +55,10 @@ namespace de4dot.blocks.cflow {
return inlineInstanceMethods; return inlineInstanceMethods;
} }
protected virtual Instruction GetFirstInstruction(IList<Instruction> instrs, ref int index) {
return DotNetUtils.GetInstruction(instrs, ref index);
}
bool InlineMethod(Instruction callInstr, int instrIndex) { bool InlineMethod(Instruction callInstr, int instrIndex) {
var methodToInline = callInstr.Operand as MethodDef; var methodToInline = callInstr.Operand as MethodDef;
if (methodToInline == null) if (methodToInline == null)
@ -67,7 +71,7 @@ namespace de4dot.blocks.cflow {
return false; return false;
int index = 0; int index = 0;
var instr = DotNetUtils.GetInstruction(body.Instructions, ref index); var instr = GetFirstInstruction(body.Instructions, ref index);
if (instr == null) if (instr == null)
return false; return false;