Skip to content

Commit

Permalink
[jit] Move the check for open constructed types later in mono_jit_com…
Browse files Browse the repository at this point in the history
…pile_method_with_opt (), this function can receive

gshared methods in llvmonly mode.

Fixes mono#7364.
  • Loading branch information
vargaz committed Mar 8, 2018
1 parent 9e1ba50 commit fb7a23f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions mono/mini/aot-tests.cs
Expand Up @@ -510,4 +510,10 @@ class GetCurrentMethodClass<T> {
}
return 0;
}

public static int test_0_regress_gh_7364 () {
var map1 = new Dictionary <Type, IntPtr> (EqualityComparer<Type>.Default);
var map2 = new Dictionary <IntPtr, WeakReference> (EqualityComparer<IntPtr>.Default);
return 0;
}
}
9 changes: 4 additions & 5 deletions mono/mini/mini-runtime.c
Expand Up @@ -2059,11 +2059,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)
Expand Down Expand Up @@ -2192,6 +2187,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);
Expand Down

0 comments on commit fb7a23f

Please sign in to comment.