From 3df94def35f0524c931abeeb6414f05bb1f7a5a2 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Thu, 20 Oct 2022 22:21:13 -0400 Subject: [PATCH] [mono][jit] Disable inlining for constrained calls on gshared parameters. (#77274) The concrete method cannot be looked up so 'cmethod' is still the interface method. Related: https://github.com/dotnet/runtime/pull/76724. --- src/mono/mono/mini/method-to-ir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono/mini/method-to-ir.c b/src/mono/mono/mini/method-to-ir.c index e927d9c00d83c..2c9c15234b25d 100644 --- a/src/mono/mono/mini/method-to-ir.c +++ b/src/mono/mono/mini/method-to-ir.c @@ -7837,7 +7837,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } /* Inlining */ - if ((cfg->opt & MONO_OPT_INLINE) && !inst_tailcall && + if ((cfg->opt & MONO_OPT_INLINE) && !inst_tailcall && !gshared_static_virtual && (!virtual_ || !(cmethod->flags & METHOD_ATTRIBUTE_VIRTUAL) || MONO_METHOD_IS_FINAL (cmethod)) && mono_method_check_inlining (cfg, cmethod)) { int costs;