Skip to content

Commit 43ab6b8

Browse files
authored
[mono][llvm] Fix an assert with --aot=llvmonly and -O=gsharedvt. (#67357)
Deopt is currently disabled for gsharedvt methods, so disable AOTing gsharedvt methods with clauses to avoid hitting an assert in emit_llvmonly_landing_pad ().
1 parent c0db07b commit 43ab6b8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/mono/mono/mini/method-to-ir.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6542,6 +6542,20 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
65426542
if (cfg->llvm_only)
65436543
g_assert (cfg->interp);
65446544

6545+
if (cfg->llvm_only && cfg->interp && cfg->method == method && !cfg->deopt && !cfg->interp_entry_only) {
6546+
if (header->num_clauses) {
6547+
/* deopt is only disabled for gsharedvt */
6548+
g_assert (cfg->gsharedvt);
6549+
for (int i = 0; i < header->num_clauses; ++i) {
6550+
MonoExceptionClause *clause = &header->clauses [i];
6551+
/* Finally clauses are checked after the remove_finally pass */
6552+
6553+
if (clause->flags != MONO_EXCEPTION_CLAUSE_FINALLY)
6554+
cfg->interp_entry_only = TRUE;
6555+
}
6556+
}
6557+
}
6558+
65456559
/* we use a separate basic block for the initialization code */
65466560
NEW_BBLOCK (cfg, init_localsbb);
65476561
if (cfg->method == method)

0 commit comments

Comments
 (0)