]> Repositorios git - scryer-prolog.git/commitdiff
correct offset retrieval in add_pstr_chars_and_step (#2370)
authorMark <[email protected]>
Mon, 25 Mar 2024 18:46:24 +0000 (12:46 -0600)
committerMark <[email protected]>
Mon, 25 Mar 2024 18:47:45 +0000 (12:47 -0600)
src/machine/system_calls.rs

index d884040d4bee99ce02900e284018f6646c8f364b..b1f3aa9e05ccec5669168deed32b8ec2945e5b1c 100644 (file)
@@ -278,7 +278,8 @@ impl BrentAlgState {
     ) -> Option<CycleSearchResult> {
         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)
             }
             _ => {