Skip to content

Commit

Permalink
fix: an address of the last argument of the supercombinator should be…
Browse files Browse the repository at this point in the history
… updated
  • Loading branch information
DavidLee18 committed Feb 19, 2025
1 parent 87bc60c commit b7481e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ fn sc_step(state: &mut TiState, sc_addr: Addr, arg_names: Vec<lang::Name>, body:
}
let is_let = body.is_let();
let result_addr = heap.instantiate(body, globals);
for _ in 0..=arg_names_len {
for _ in 0..arg_names_len {
stack.pop();
}
heap.update(
arg_bindings.last().map(|(_, a)| *a).unwrap_or(sc_addr),
stack.pop().unwrap_or(sc_addr),
Node::Ind(result_addr),
);
stack.push(result_addr);
Expand Down

0 comments on commit b7481e7

Please sign in to comment.