Skip to content

Commit

Permalink
[mono][jit] Disable inlining for constrained calls on gshared paramet…
Browse files Browse the repository at this point in the history
…ers. (#77274)

The concrete method cannot be looked up so 'cmethod' is still the interface method.

Related: #76724.
  • Loading branch information
vargaz authored Oct 21, 2022
1 parent 76c960b commit 3df94de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mono/mono/mini/method-to-ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3df94de

Please sign in to comment.