From f638a1a5487d77816aaf88a4d331cd832e11f8d1 Mon Sep 17 00:00:00 2001 From: Leon Shen Date: Sun, 2 Aug 2020 22:08:52 -0700 Subject: [PATCH] Fix small bug in #36684 PR #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. --- base/compiler/ssair/ir.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/compiler/ssair/ir.jl b/base/compiler/ssair/ir.jl index 8477e3d92086a..b847281d9bccb 100644 --- a/base/compiler/ssair/ir.jl +++ b/base/compiler/ssair/ir.jl @@ -1245,7 +1245,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