From: Mark Thom Date: Tue, 21 Apr 2026 21:31:53 +0000 (-0700) Subject: take Lis index from rd in copy_var (#3298) X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=010b00f3495b14f282d7b91f0d959915cd225fae;p=scryer-prolog.git take Lis index from rd in copy_var (#3298) --- diff --git a/src/machine/copier.rs b/src/machine/copier.rs index dec0f427..e6ce699c 100644 --- a/src/machine/copier.rs +++ b/src/machine/copier.rs @@ -384,7 +384,6 @@ impl CopyTermState { } fn copy_var(&mut self, addr: HeapCellValue) -> Result<(), AllocError> { - let index = addr.get_value() as usize; let rd = self.target.deref(addr); let ra = self.target.store(rd); @@ -397,6 +396,7 @@ impl CopyTermState { } } (HeapCellValueTag::Lis, h) => { + let index = rd.get_value() as usize; if h >= self.old_h && self.target[index].get_mark_bit() { *self.value_at_scan() = heap_loc_as_cell!( if ra.get_forwarding_bit() {