From d0e997da57ba9776afd98a42783117a1f4e1a8ca Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Fri, 18 Apr 2025 00:03:33 -0700 Subject: [PATCH] repair cyclic PStrLoc handling in heap_print.rs --- src/heap_print.rs | 9 +++++++-- src/machine/machine_state.rs | 4 ---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/heap_print.rs b/src/heap_print.rs index f11fb4d5..c2b60657 100644 --- a/src/heap_print.rs +++ b/src/heap_print.rs @@ -879,7 +879,12 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { } else { debug_assert!(cell.is_ref()); - let h = cell.get_value() as usize; + let h = if cell.get_tag() == HeapCellValueTag::PStrLoc { + self.iter.focus().value() + } else { + cell.get_value() + } as usize; + self.iter.push_stack(IterStackLoc::iterable_loc( h, HeapOrStackTag::Heap, @@ -909,7 +914,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { orig_cell = cell; continue; } - } + }; } } diff --git a/src/machine/machine_state.rs b/src/machine/machine_state.rs index 049f131c..7c8f1abe 100644 --- a/src/machine/machine_state.rs +++ b/src/machine/machine_state.rs @@ -731,10 +731,6 @@ impl MachineState { ) ); - for var in term_write_result.var_dict.values_mut() { - *var = heap_bound_deref(&self.heap, *var); - } - let mut var_list = Vec::with_capacity(singleton_var_set.len()); for (var_name, addr) in term_write_result.var_dict { -- 2.54.0