From 40fc4f939261a4dbdc73ef69991fc5d2a4d2bb4e Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 25 Mar 2024 12:46:24 -0600 Subject: [PATCH] correct offset retrieval in add_pstr_chars_and_step (#2370) --- src/machine/system_calls.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) } _ => { -- 2.54.0