Skip to content

Commit e8f878c

Browse files
committed
Take fast path only for delegate types not Delegate/MulticastDelegate (case 1085270)
See upstream PR: mono#11182
1 parent 0170c00 commit e8f878c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mono/metadata/icall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3950,7 +3950,7 @@ mono_class_get_methods_by_name (MonoClass *klass, const char *name, guint32 bfla
39503950
compare_func = (ignore_case) ? mono_utf8_strcasecmp : strcmp;
39513951

39523952
/* An optimization for calls made from Delegate:CreateDelegate () */
3953-
if (klass->delegate && name && !strcmp (name, "Invoke") && (bflags == (BFLAGS_Public | BFLAGS_Static | BFLAGS_Instance))) {
3953+
if (klass->delegate && klass != mono_defaults.delegate_class && klass != mono_defaults.multicastdelegate_class&& name && !strcmp (name, "Invoke") && (bflags == (BFLAGS_Public | BFLAGS_Static | BFLAGS_Instance))) {
39543954
method = mono_get_delegate_invoke (klass);
39553955
g_assert (method);
39563956

0 commit comments

Comments
 (0)