Skip to content

Commit 9bc96d0

Browse files
authored
[mono][interp] Disable optimization in weird scenario of infinite loop (#99032)
It was confused by code like: ``` BB1: IL_0000: br [nil <- nil], BB1 ```
1 parent d7d3c6b commit 9bc96d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mono/mono/mini/interp/transform-opt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1959,7 +1959,8 @@ interp_reorder_bblocks (TransformData *td)
19591959
InterpInst *last_ins = interp_last_ins (in_bb);
19601960
if (last_ins && (MINT_IS_CONDITIONAL_BRANCH (last_ins->opcode) ||
19611961
MINT_IS_UNCONDITIONAL_BRANCH (last_ins->opcode)) &&
1962-
last_ins->info.target_bb == bb) {
1962+
last_ins->info.target_bb == bb &&
1963+
in_bb != bb) {
19631964
InterpBasicBlock *target_bb = first->info.target_bb;
19641965
last_ins->info.target_bb = target_bb;
19651966
interp_unlink_bblocks (in_bb, bb);

0 commit comments

Comments
 (0)