Make sure no generic methods are inlined

This commit is contained in:
de4dot 2012-02-25 06:33:38 +01:00
parent 10ceb12e30
commit da1d649ef4
2 changed files with 4 additions and 0 deletions

View File

@ -41,6 +41,8 @@ namespace de4dot.blocks.cflow {
}
protected virtual bool canInline(MethodDefinition method) {
if (method.GenericParameters.Count > 0)
return false;
if (MemberReferenceHelper.compareMethodReferenceAndDeclaringType(method, blocks.Method))
return false;
if (!MemberReferenceHelper.compareTypes(method.DeclaringType, blocks.Method.DeclaringType))

View File

@ -166,6 +166,8 @@ checkInline:
public static bool canInline(MethodDefinition method) {
if (method == null || method.Body == null)
return false;
if (method.GenericParameters.Count > 0)
return false;
if (method.Body.ExceptionHandlers.Count > 0)
return false;
var parameters = method.Parameters;