Make sure no generic methods are inlined
This commit is contained in:
parent
10ceb12e30
commit
da1d649ef4
|
@ -41,6 +41,8 @@ namespace de4dot.blocks.cflow {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual bool canInline(MethodDefinition method) {
|
protected virtual bool canInline(MethodDefinition method) {
|
||||||
|
if (method.GenericParameters.Count > 0)
|
||||||
|
return false;
|
||||||
if (MemberReferenceHelper.compareMethodReferenceAndDeclaringType(method, blocks.Method))
|
if (MemberReferenceHelper.compareMethodReferenceAndDeclaringType(method, blocks.Method))
|
||||||
return false;
|
return false;
|
||||||
if (!MemberReferenceHelper.compareTypes(method.DeclaringType, blocks.Method.DeclaringType))
|
if (!MemberReferenceHelper.compareTypes(method.DeclaringType, blocks.Method.DeclaringType))
|
||||||
|
|
|
@ -166,6 +166,8 @@ checkInline:
|
||||||
public static bool canInline(MethodDefinition method) {
|
public static bool canInline(MethodDefinition method) {
|
||||||
if (method == null || method.Body == null)
|
if (method == null || method.Body == null)
|
||||||
return false;
|
return false;
|
||||||
|
if (method.GenericParameters.Count > 0)
|
||||||
|
return false;
|
||||||
if (method.Body.ExceptionHandlers.Count > 0)
|
if (method.Body.ExceptionHandlers.Count > 0)
|
||||||
return false;
|
return false;
|
||||||
var parameters = method.Parameters;
|
var parameters = method.Parameters;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user