diff --git a/src/mono/mono/mini/aot-tests.cs b/src/mono/mono/mini/aot-tests.cs index 61ce3623370f1d..e111f5291860c4 100644 --- a/src/mono/mono/mini/aot-tests.cs +++ b/src/mono/mono/mini/aot-tests.cs @@ -510,4 +510,10 @@ public static int test_0_fault_clauses () { } return 0; } + + public static int test_0_regress_gh_7364 () { + var map1 = new Dictionary (EqualityComparer.Default); + var map2 = new Dictionary (EqualityComparer.Default); + return 0; + } } diff --git a/src/mono/mono/mini/mini-runtime.c b/src/mono/mono/mini/mini-runtime.c index bb5f2560650389..c9f74fbe5e57c8 100644 --- a/src/mono/mono/mini/mini-runtime.c +++ b/src/mono/mono/mini/mini-runtime.c @@ -2063,11 +2063,6 @@ mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, gboolean jit_ error_init (error); - if (mono_class_is_open_constructed_type (&method->klass->byval_arg)) { - mono_error_set_invalid_operation (error, "Could not execute the method because the containing type is not fully instantiated."); - return NULL; - } - if (mono_use_interpreter && !jit_only) { code = mini_get_interp_callbacks ()->create_method_pointer (method, error); if (code) @@ -2196,6 +2191,10 @@ mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, gboolean jit_ } if (!code) { + if (mono_class_is_open_constructed_type (&method->klass->byval_arg)) { + mono_error_set_invalid_operation (error, "Could not execute the method because the containing type is not fully instantiated."); + return NULL; + } if (wait_or_register_method_to_compile (method, target_domain)) goto lookup_start; code = mono_jit_compile_method_inner (method, target_domain, opt, error);