Skip to content

Commit

Permalink
Fix small bug in JuliaLang#36684
Browse files Browse the repository at this point in the history
PR JuliaLang#36684 changes `iterate(IncrementalCompact)` to return an extra index, but
leaves its arguments unchanged. However, the PR decremented the index argument
in a particular recursive call to `iterate`. This caused `iterate` not to
recognise that it was done when `allow_cfg_transforms` was turned on.
  • Loading branch information
yhls committed Aug 3, 2020
1 parent 425939e commit 9fd6420
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 @@ -1206,7 +1206,7 @@ function iterate(compact::IncrementalCompact, (idx, active_bb)::Tuple{Int, Int}=
# Move to next block
compact.idx += 1
if finish_current_bb!(compact, active_bb, old_result_idx, true)
return iterate(compact, (compact.idx-1, active_bb + 1))
return iterate(compact, (compact.idx, active_bb + 1))
else
return Pair{Pair{Int, Int}, Any}(Pair{Int,Int}(compact.idx-1, old_result_idx), compact.result[old_result_idx][:inst]), (compact.idx, active_bb + 1)
end
Expand Down

0 comments on commit 9fd6420

Please sign in to comment.