Skip to content

Commit 4bfae75

Browse files
committed
fix if block_idx == BlockIdx::NULL
1 parent da8bdcc commit 4bfae75

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

crates/codegen/src/ir.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8262,7 +8262,10 @@ impl CodeInfo {
82628262
}
82638263
}
82648264
if block_has_fallthrough(block) && block.next != BlockIdx::NULL {
8265-
stack.push(next_nonempty_block(blocks, block.next));
8265+
let next = next_nonempty_block(blocks, block.next);
8266+
if next != BlockIdx::NULL {
8267+
stack.push(next);
8268+
}
82668269
}
82678270
}
82688271
false
@@ -8308,7 +8311,10 @@ impl CodeInfo {
83088311
}
83098312
}
83108313
if block_has_fallthrough(block) && block.next != BlockIdx::NULL {
8311-
stack.push((next_nonempty_block(blocks, block.next), stores_local));
8314+
let next = next_nonempty_block(blocks, block.next);
8315+
if next != BlockIdx::NULL {
8316+
stack.push((next, stores_local));
8317+
}
83128318
}
83138319
}
83148320
false
@@ -8849,7 +8855,10 @@ impl CodeInfo {
88498855
}
88508856
}
88518857
if block_has_fallthrough(block) && block.next != BlockIdx::NULL {
8852-
stack.push(next_nonempty_block(blocks, block.next));
8858+
let next = next_nonempty_block(blocks, block.next);
8859+
if next != BlockIdx::NULL {
8860+
stack.push(next);
8861+
}
88538862
}
88548863
}
88558864
false

0 commit comments

Comments
 (0)