remove list remnants from stack iteration in printer when cyclic (#2131)

This commit is contained in:
Mark
2023-10-24 14:10:11 -06:00
parent 4ab3e23b1f
commit 773d3f81fd
4 changed files with 27 additions and 11 deletions

View File

@@ -888,6 +888,19 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
var_opt => {
if is_cyclic && cell.is_compound(self.iter.heap) {
// self-referential variables are marked "cyclic".
read_heap_cell!(cell,
(HeapCellValueTag::Lis, vh) => {
if self.iter.heap[vh].get_forwarding_bit() {
self.iter.pop_stack();
}
if self.iter.heap[vh+1].get_forwarding_bit() {
self.iter.pop_stack();
}
}
_ => {}
);
match var_opt {
Some(var) => {
// If the term is bound to a named variable,