Skip to content

Commit

Permalink
[mono][llvm] Fix an assert with --aot=llvmonly and -O=gsharedvt. (#67357
Browse files Browse the repository at this point in the history
)

Deopt is currently disabled for gsharedvt methods, so disable AOTing
gsharedvt methods with clauses to avoid hitting an assert in
emit_llvmonly_landing_pad ().
  • Loading branch information
vargaz committed Mar 31, 2022
1 parent c0db07b commit 43ab6b8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/mono/mono/mini/method-to-ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -6542,6 +6542,20 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
if (cfg->llvm_only)
g_assert (cfg->interp);

if (cfg->llvm_only && cfg->interp && cfg->method == method && !cfg->deopt && !cfg->interp_entry_only) {
if (header->num_clauses) {
/* deopt is only disabled for gsharedvt */
g_assert (cfg->gsharedvt);
for (int i = 0; i < header->num_clauses; ++i) {
MonoExceptionClause *clause = &header->clauses [i];
/* Finally clauses are checked after the remove_finally pass */

if (clause->flags != MONO_EXCEPTION_CLAUSE_FINALLY)
cfg->interp_entry_only = TRUE;
}
}
}

/* we use a separate basic block for the initialization code */
NEW_BBLOCK (cfg, init_localsbb);
if (cfg->method == method)
Expand Down

0 comments on commit 43ab6b8

Please sign in to comment.