Merge branch 'master' into spices
This commit is contained in:
commit
f512bc8953
|
@ -40,7 +40,12 @@ namespace de4dot.blocks.cflow {
|
|||
return changed;
|
||||
}
|
||||
|
||||
bool canInline(MethodDefinition method) {
|
||||
protected virtual bool canInline(MethodDefinition method) {
|
||||
if (MemberReferenceHelper.compareMethodReferenceAndDeclaringType(method, blocks.Method))
|
||||
return false;
|
||||
if (!MemberReferenceHelper.compareTypes(method.DeclaringType, blocks.Method.DeclaringType))
|
||||
return false;
|
||||
|
||||
if (method.IsStatic)
|
||||
return true;
|
||||
if (method.IsVirtual)
|
||||
|
@ -52,16 +57,12 @@ namespace de4dot.blocks.cflow {
|
|||
var methodToInline = callInstr.Operand as MethodDefinition;
|
||||
if (methodToInline == null)
|
||||
return false;
|
||||
if (MemberReferenceHelper.compareMethodReferenceAndDeclaringType(methodToInline, blocks.Method))
|
||||
return false;
|
||||
|
||||
if (!canInline(methodToInline))
|
||||
return false;
|
||||
var body = methodToInline.Body;
|
||||
if (body == null)
|
||||
return false;
|
||||
if (!MemberReferenceHelper.compareTypes(methodToInline.DeclaringType, blocks.Method.DeclaringType))
|
||||
return false;
|
||||
|
||||
int index = 0;
|
||||
var instr = DotNetUtils.getInstruction(body.Instructions, ref index);
|
||||
|
|
Loading…
Reference in New Issue
Block a user