Skip to content

Commit

Permalink
make sure basic_block_index is sorted (#45180)
Browse files Browse the repository at this point in the history
Found `block_for_inst(index::Vector{Int}, ::Int)` expects `index` to be
sorted, but we didn't sort it explicitly previously.
  • Loading branch information
aviatesk authored May 7, 2022
1 parent e6fc03d commit 3e9cecd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/compiler/ssair/ir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function compute_basic_blocks(stmts::Vector{Any})
bb_starts = basic_blocks_starts(stmts)
# Compute ranges
pop!(bb_starts, 1)
basic_block_index = collect(bb_starts)
basic_block_index = sort!(collect(bb_starts); alg=QuickSort)
blocks = BasicBlock[]
sizehint!(blocks, length(basic_block_index))
let first = 1
Expand Down

0 comments on commit 3e9cecd

Please sign in to comment.