mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 03:39:35 -10:00
[mono][jit] Compute the type of generic context used by static virtual calls properly. (#65459)
Fixes https://github.com/dotnet/runtime/issues/65394.
This commit is contained in:
1 parent
36a79fcffc
commit
4e2a7da660
1 file changed
+5
-2
@@ -2749,6 +2749,9 @@ emit_get_rgctx_virt_method (MonoCompile *cfg, int context_used,
|
||||
MonoJumpInfoVirtMethod *info;
|
||||
MonoJumpInfoRgctxEntry *entry;
|
||||
|
||||
if (context_used == -1)
|
||||
context_used = mono_class_check_context_used (klass) | mono_method_check_context_used (virt_method);
|
||||
|
||||
info = (MonoJumpInfoVirtMethod *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoJumpInfoVirtMethod));
|
||||
info->klass = klass;
|
||||
info->method = virt_method;
|
||||
@@ -7980,7 +7983,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
|
||||
addr = emit_get_rgctx_method (cfg, context_used, cmethod, MONO_RGCTX_INFO_GSHAREDVT_OUT_WRAPPER);
|
||||
} else {
|
||||
if (gshared_static_virtual)
|
||||
addr = emit_get_rgctx_virt_method (cfg, mono_class_check_context_used (constrained_class), constrained_class, cmethod, MONO_RGCTX_INFO_VIRT_METHOD_CODE);
|
||||
addr = emit_get_rgctx_virt_method (cfg, -1, constrained_class, cmethod, MONO_RGCTX_INFO_VIRT_METHOD_CODE);
|
||||
else
|
||||
addr = emit_get_rgctx_method (cfg, context_used, cmethod, MONO_RGCTX_INFO_METHOD_FTNDESC);
|
||||
}
|
||||
@@ -7994,7 +7997,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
|
||||
* cmethod is a static interface method, the actual called method at runtime
|
||||
* needs to be computed using constrained_class and cmethod.
|
||||
*/
|
||||
addr = emit_get_rgctx_virt_method (cfg, mono_class_check_context_used (constrained_class), constrained_class, cmethod, MONO_RGCTX_INFO_VIRT_METHOD_CODE);
|
||||
addr = emit_get_rgctx_virt_method (cfg, -1, constrained_class, cmethod, MONO_RGCTX_INFO_VIRT_METHOD_CODE);
|
||||
} else {
|
||||
addr = emit_get_rgctx_method (cfg, context_used, cmethod, MONO_RGCTX_INFO_GENERIC_METHOD_CODE);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user