correct cycle detection in ground/1 (#2073)

This commit is contained in:
Mark
2023-10-03 12:04:10 -06:00
parent 07d7d3b13b
commit fd14869ddc

View File

@@ -1648,7 +1648,7 @@ impl MachineState {
} }
} }
if value.is_compound(iter.heap) { if value.is_ref() {
if visited.contains(&value) { if visited.contains(&value) {
for _ in stack_len..iter.stack_len() { for _ in stack_len..iter.stack_len() {
iter.pop_stack(); iter.pop_stack();
@@ -1686,7 +1686,7 @@ impl MachineState {
}, },
Ok(Number::Integer(n)) => { Ok(Number::Integer(n)) => {
let b: u8 = (&*n).try_into().unwrap(); let b: u8 = (&*n).try_into().unwrap();
bytes.push(b); bytes.push(b);
} }
_ => {} _ => {}