From 49a702f0cf2d03875a6c3f00fb9702d4f8dbc8b9 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Tue, 8 Mar 2011 04:19:31 +0100 Subject: [PATCH] Don't use ".Invoke" for delegate invocations. --- ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs b/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs index a85b773f9..9b3d43ef3 100644 --- a/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs +++ b/ICSharpCode.Decompiler/Ast/AstMethodBodyBuilder.cs @@ -595,6 +595,9 @@ namespace ICSharpCode.Decompiler.Ast }; } } + } else if (cecilMethodDef.Name == "Invoke" && cecilMethodDef.DeclaringType.BaseType.FullName == "System.MulticastDelegate") { + AdjustArgumentsForMethodCall(cecilMethod, methodArgs); + return target.Invoke(methodArgs); } } // Default invocation