Skip to content

Commit bd22db0

Browse files
authored
[mono][jit] Pass generic context when ldftn of generic method (#66350)
1 parent 4d39501 commit bd22db0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/mono/mono/mini/jit-icalls.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,13 @@ mono_ldftn (MonoMethod *method)
5757

5858
/* if we need the address of a native-to-managed wrapper, just compile it now, trampoline needs thread local
5959
* variables that won't be there if we run on a thread that's not attached yet. */
60-
if (method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED)
60+
if (method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) {
6161
addr = mono_compile_method_checked (method, error);
62-
else
62+
} else {
6363
addr = mono_create_jump_trampoline (method, FALSE, error);
64+
if (mono_method_needs_static_rgctx_invoke (method, FALSE))
65+
addr = mono_create_static_rgctx_trampoline (method, addr);
66+
}
6467
if (!is_ok (error)) {
6568
mono_error_set_pending_exception (error);
6669
return NULL;

0 commit comments

Comments
 (0)