fix off-by-one lam loop (#3081)

This commit is contained in:
Mark Thom
2025-09-15 21:52:43 -07:00
parent dc05526c71
commit 24f431e2ca

View File

@@ -719,7 +719,7 @@ impl MachineState {
let mut hare = orig_hare; let mut hare = orig_hare;
let mut tortoise = hare; let mut tortoise = hare;
for _ in 1..lam { for _ in 0..lam {
hare = step(&self.heap, self.heap[hare]); hare = step(&self.heap, self.heap[hare]);
} }
@@ -743,8 +743,6 @@ impl MachineState {
brent_st.cycle_step(&self.heap); brent_st.cycle_step(&self.heap);
} }
// self.heap.pop_cell();
let target_n = self.store(self.deref(self.registers[1])); let target_n = self.store(self.deref(self.registers[1]));
self.unify_fixnum( self.unify_fixnum(
/* FIXME this is not safe */ /* FIXME this is not safe */