Skip to content

Commit

Permalink
chapter11: use correct index
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertObkircher committed Jan 1, 2025
1 parent 4c7ce6d commit 181e126
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sea_of_nodes/global_code_motion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ fn _sched_late(n: Node, ns: &mut Vec<Option<Node>>, late: &mut Vec<Option<Cfg>>,
/// to the matching Region input.
fn use_block(n: Node, use_: Node, late: &[Option<Cfg>], sea: &Nodes) -> Cfg {
let Some(phi) = use_.to_phi(sea) else {
return late[n.index()].unwrap();
return late[use_.index()].unwrap();
};
let mut found = None;
for i in 1..phi.inputs(sea).len() {
Expand Down

0 comments on commit 181e126

Please sign in to comment.