diff options
Diffstat (limited to 'mcs')
-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; |