Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix insert_node_here! if called at the end of the IR #39021

Merged
merged 1 commit into from
Dec 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion base/compiler/ssair/ir.jl
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,9 @@ end
function insert_node_here!(compact::IncrementalCompact, @nospecialize(val), @nospecialize(typ), ltable_idx::Int32, reverse_affinity::Bool=false)
refinish = false
result_idx = compact.result_idx
if result_idx == first(compact.result_bbs[compact.active_result_bb].stmts) && reverse_affinity
if reverse_affinity &&
((compact.active_result_bb == length(compact.result_bbs) + 1) ||
result_idx == first(compact.result_bbs[compact.active_result_bb].stmts))
compact.active_result_bb -= 1
refinish = true
end
Expand Down