From d6b708106d852c8e2803fff727fe98ec5f7a85f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 25 Oct 2019 20:27:34 +0200 Subject: [PATCH] [netcore] Don't load types in aot-compiler.c that don't exist in corefx Fixes https://github.com/mono/mono/issues/16026 Commit migrated from https://github.com/mono/mono/commit/fb7b075e4930751421a5feb0b9ac095d832df228 --- src/mono/mono/mini/aot-compiler.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index e28670c..ac31793 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -5266,6 +5266,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth, else name_prefix = g_strdup_printf ("%s.%s", klass_name_space, klass_name); +#ifndef ENABLE_NETCORE /* Add the T[]/InternalEnumerator class */ if (!strcmp (klass_name, "IEnumerable`1") || !strcmp (klass_name, "IEnumerator`1")) { ERROR_DECL (error); @@ -5281,6 +5282,7 @@ add_generic_class_with_depth (MonoAotCompile *acfg, MonoClass *klass, int depth, mono_error_assert_ok (error); /* FIXME don't swallow the error */ add_generic_class (acfg, nclass, FALSE, "ICollection"); } +#endif iter = NULL; while ((method = mono_class_get_methods (array_class, &iter))) { @@ -5647,6 +5649,7 @@ add_generic_instances (MonoAotCompile *acfg) enum_comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "EnumEqualityComparer`1"); add_instances_of (acfg, enum_comparer, insts, ninsts, FALSE); +#ifndef ENABLE_NETCORE ninsts = 0; insts [ninsts ++] = int16_type; enum_comparer = mono_class_load_from_name (mono_defaults.corlib, "System.Collections.Generic", "ShortEnumEqualityComparer`1"); @@ -5662,6 +5665,7 @@ add_generic_instances (MonoAotCompile *acfg) insts [ninsts ++] = int64_type; insts [ninsts ++] = uint64_type; add_instances_of (acfg, enum_comparer, insts, ninsts, FALSE); +#endif } /* Add instances of the array generic interfaces for primitive types */ -- 2.7.4