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 (mono/mono#7494)

gshared methods in llvmonly mode.

Fixes mono/mono#7364.

Commit migrated from mono/mono@c745a95
  • Loading branch information
vargaz authored and luhenry committed Mar 9, 2018
1 parent 846149a commit bd1a449
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/mono/mono/mini/aot-tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Type, IntPtr> (EqualityComparer<Type>.Default);
var map2 = new Dictionary <IntPtr, WeakReference> (EqualityComparer<IntPtr>.Default);
return 0;
}
}
9 changes: 4 additions & 5 deletions src/mono/mono/mini/mini-runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit bd1a449

Please sign in to comment.