Skip to content

Commit

Permalink
Fix small issue in EnterNode rename (#52589)
Browse files Browse the repository at this point in the history
Fixes issue noted at [1] - not sure why it didn't show up in CI on the
PR.

[1]
#52527 (comment)
  • Loading branch information
Keno authored Dec 21, 2023
1 parent 39087c5 commit fb3e387
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/compiler/ssair/ir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1422,11 +1422,11 @@ function process_node!(compact::IncrementalCompact, result_idx::Int, inst::Instr
if stmt.catch_dest != 0
label = bb_rename_succ[stmt.catch_dest]
@assert label > 0
ssa_rename[idx] = SSAValue(result_idx)
result[result_idx][:stmt] = EnterNode(stmt, label)
else
result[result_idx][:stmt] = stmt
end
ssa_rename[idx] = SSAValue(result_idx)
result_idx += 1
elseif isa(stmt, Expr)
stmt = renumber_ssa2!(stmt, ssa_rename, used_ssas, new_new_used_ssas, late_fixup, result_idx, do_rename_ssa, mark_refined!)::Expr
Expand Down
7 changes: 6 additions & 1 deletion base/compiler/ssair/verify.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ function verify_ir(ir::IRCode, print::Bool=true,
end
elseif isa(terminator, EnterNode)
@label enter_check
if length(block.succs) != 2 || (block.succs != Int[terminator.catch_dest, idx+1] && block.succs != Int[idx+1, terminator.catch_dest])
if length(block.succs) == 1
if terminator.catch_dest != 0
@verify_error "Block $idx successors ($(block.succs)), does not match :enter terminator"
error("")
end
elseif (block.succs != Int[terminator.catch_dest, idx+1] && block.succs != Int[idx+1, terminator.catch_dest])
@verify_error "Block $idx successors ($(block.succs)), does not match :enter terminator"
error("")
end
Expand Down

0 comments on commit fb3e387

Please sign in to comment.