Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[mono][mini] Disable inlining if we encounter class initialization fa…
…ilure

method_make_alwaysthrow_typeloadfailure replaces the entire method code with a throw of type load exception. This behaviour not only seem dubious, if it is triggered from inlining a method, that might never even get called, but it also does changes to the set of basic blocks that can lead to crashes later on during compilation.
  • Loading branch information
BrzVlad authored and github-actions committed Jan 30, 2025
commit b820b5854d048cba6cfedcb6d0a0b8ba08a02189
2 changes: 2 additions & 0 deletions src/mono/mono/mini/method-to-ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -10143,6 +10143,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
EMIT_NEW_PCONST (cfg, *sp, NULL);
sp++;
} else if (il_op == MONO_CEE_LDFLD || il_op == MONO_CEE_LDSFLD) {
// method_make_alwaysthrow_typeloadfailure currently doesn't work with inlining
INLINE_FAILURE("type load error");
// An object is expected here. It may be impossible to correctly infer its type,
// we turn this entire method into a throw.
method_make_alwaysthrow_typeloadfailure (cfg, klass);
Expand Down
Loading