diff options
| author | Max Bernstein <ruby@bernsteinbear.com> | 2025-12-02 10:28:41 -0800 |
|---|---|---|
| committer | Max Bernstein <tekknolagi@gmail.com> | 2025-12-03 20:13:02 -0500 |
| commit | 19f0df04ff733f687bf33ebd9c85285c5e733253 (patch) | |
| tree | ca46f6de79e5898943d7f4e787fe0befd672fb2a | |
| parent | c764269fbc4e2e58cea7c3880fa1485c7d2db123 (diff) | |
ZJIT: Fix definite assignment to work with multiple entry blocks
| -rw-r--r-- | zjit/src/hir.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs index b51a55db93..9d38336f89 100644 --- a/zjit/src/hir.rs +++ b/zjit/src/hir.rs @@ -4165,11 +4165,13 @@ impl Function { // missing location. let mut assigned_in = vec![None; self.num_blocks()]; let rpo = self.rpo(); - // Begin with every block having every variable defined, except for the entry block, which - // starts with nothing defined. - assigned_in[self.entry_block.0] = Some(InsnSet::with_capacity(self.insns.len())); + // Begin with every block having every variable defined, except for the entry blocks, which + // start with nothing defined. + let entry_blocks = self.entry_blocks(); for &block in &rpo { - if block != self.entry_block { + if entry_blocks.contains(&block) { + assigned_in[block.0] = Some(InsnSet::with_capacity(self.insns.len())); + } else { let mut all_ones = InsnSet::with_capacity(self.insns.len()); all_ones.insert_all(); assigned_in[block.0] = Some(all_ones); |
