diff options
author | Ludovic Henry <ludovic@xamarin.com> | 2015-09-09 18:10:19 +0300 |
---|---|---|
committer | Ludovic Henry <ludovic@xamarin.com> | 2015-09-17 18:34:41 +0300 |
commit | 4a7fcac07559a6458e3d8a5fb01f2bc182153ab3 (patch) | |
tree | 80b46aa1c5fbda6ba73b7c777f6f1d69447183e3 /mcs/class/corlib/System/Delegate.cs | |
parent | 11ce499c406bc09c4c3b4a2def21618cbdb8696d (diff) |
[delegate] Fix bug #33218 "Action ReflectedType differs from Delegate ReflectedType"
Diffstat (limited to 'mcs/class/corlib/System/Delegate.cs')
-rw-r--r-- | mcs/class/corlib/System/Delegate.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mcs/class/corlib/System/Delegate.cs b/mcs/class/corlib/System/Delegate.cs index c2f92a7f73b..ba97e726509 100644 --- a/mcs/class/corlib/System/Delegate.cs +++ b/mcs/class/corlib/System/Delegate.cs @@ -68,6 +68,8 @@ namespace System private MethodInfo original_method_info; private DelegateData data; + + private bool method_is_virtual; #pragma warning restore 169, 414, 649 #endregion @@ -103,13 +105,19 @@ namespace System return method_info; } else { if (method != IntPtr.Zero) { - method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method)); + if (!method_is_virtual) + method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method)); + else + method_info = GetVirtualMethod_internal (); } return method_info; } } } + [MethodImplAttribute (MethodImplOptions.InternalCall)] + extern MethodInfo GetVirtualMethod_internal (); + public object Target { get { return m_target; |