Skip to content

Commit 4780116

Browse files
authored
Merge pull request #1056 from Unity-Technologies/unity-master-bug-1085270
Take fast path only for delegate types not Delegate/MulticastDelegate…
2 parents 0170c00 + e8f878c commit 4780116

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)