From: Mark Date: Mon, 25 Mar 2024 18:46:24 +0000 (-0600) Subject: correct offset retrieval in add_pstr_chars_and_step (#2370) X-Git-Tag: v0.10.0~149 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=40fc4f939261a4dbdc73ef69991fc5d2a4d2bb4e;p=scryer-prolog.git correct offset retrieval in add_pstr_chars_and_step (#2370) --- diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index d884040d..b1f3aa9e 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -278,7 +278,8 @@ impl BrentAlgState { ) -> Option { read_heap_cell!(heap[h], (HeapCellValueTag::PStrOffset, l) => { - let (pstr_loc, offset) = pstr_loc_and_offset(heap, l); + let (pstr_loc, _) = pstr_loc_and_offset(heap, l); + let offset = cell_as_fixnum!(heap[h+1]); self.add_pstr_offset_chars(heap, pstr_loc, offset.get_num() as usize) } _ => {