From 478595708b0e2cc879919dfcdf6a6e794948daf8 Mon Sep 17 00:00:00 2001 From: de4dot Date: Sat, 12 Oct 2013 01:00:50 +0200 Subject: [PATCH] Add MethodCallInliner::GetFirstInstruction() --- de4dot.blocks/cflow/MethodCallInliner.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/de4dot.blocks/cflow/MethodCallInliner.cs b/de4dot.blocks/cflow/MethodCallInliner.cs index 3504a658..4265e706 100644 --- a/de4dot.blocks/cflow/MethodCallInliner.cs +++ b/de4dot.blocks/cflow/MethodCallInliner.cs @@ -55,6 +55,10 @@ namespace de4dot.blocks.cflow { return inlineInstanceMethods; } + protected virtual Instruction GetFirstInstruction(IList instrs, ref int index) { + return DotNetUtils.GetInstruction(instrs, ref index); + } + bool InlineMethod(Instruction callInstr, int instrIndex) { var methodToInline = callInstr.Operand as MethodDef; if (methodToInline == null) @@ -67,7 +71,7 @@ namespace de4dot.blocks.cflow { return false; int index = 0; - var instr = DotNetUtils.GetInstruction(body.Instructions, ref index); + var instr = GetFirstInstruction(body.Instructions, ref index); if (instr == null) return false;