Skip to content

Commit

Permalink
[mono][llvm] Avoid linking a bblock ending with a NOT_REACHABLE with …
Browse files Browse the repository at this point in the history
…their successors. (dotnet#97660)

This prevents llvm from failing for methods like Guid.FormatGuidVector128Utf8 ().
  • Loading branch information
vargaz authored Jan 30, 2024
1 parent 7c95e52 commit d40c654
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mono/mono/mini/method-to-ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -7061,11 +7061,14 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
emit_set_deopt_il_offset (cfg, GPTRDIFF_TO_INT (ip - cfg->cil_start));
} else {
if ((tblock = cfg->cil_offset_to_bb [ip - cfg->cil_start]) && (tblock != cfg->cbb)) {
link_bblock (cfg, cfg->cbb, tblock);
if (sp != stack_start) {
link_bblock (cfg, cfg->cbb, tblock);
handle_stack_args (cfg, stack_start, GPTRDIFF_TO_INT (sp - stack_start));
sp = stack_start;
CHECK_UNVERIFIABLE (cfg);
} else {
if (!(cfg->cbb->last_ins && cfg->cbb->last_ins->opcode == OP_NOT_REACHED))
link_bblock (cfg, cfg->cbb, tblock);
}
cfg->cbb->next_bb = tblock;
cfg->cbb = tblock;
Expand Down

0 comments on commit d40c654

Please sign in to comment.