check for PStr in eager stackful preorder iterator before adding tail of PStrOffset (#2272)

This commit is contained in:
Mark
2024-01-08 17:36:41 -07:00
parent f9eadc8e6a
commit cd89d71e0c
2 changed files with 7 additions and 5 deletions

View File

@@ -108,7 +108,7 @@ impl<'a> EagerStackfulPreOrderHeapIter<'a> {
let var_value = self.heap[h]; let var_value = self.heap[h];
self.heap[h].set_mark_bit(self.mark_phase); self.heap[h].set_mark_bit(self.mark_phase);
if !(self.heap[h].is_var() && self.heap[h].get_value() as usize == h) { if var_value.get_mark_bit() || !(self.heap[h].is_var() && self.heap[h].get_value() as usize == h) {
self.iter_stack.push(var_value); self.iter_stack.push(var_value);
continue; continue;
} }
@@ -125,12 +125,13 @@ impl<'a> EagerStackfulPreOrderHeapIter<'a> {
continue; continue;
} }
let value = self.heap[h+1];
self.heap[h].set_mark_bit(self.mark_phase); self.heap[h].set_mark_bit(self.mark_phase);
self.heap[h+1].set_mark_bit(self.mark_phase);
self.iter_stack.push(value); if self.heap[h].get_tag() == HeapCellValueTag::PStr {
let value = self.heap[h+1];
self.heap[h+1].set_mark_bit(self.mark_phase);
self.iter_stack.push(value);
}
} }
_ => { _ => {
} }

View File

@@ -578,6 +578,7 @@ impl MachineState {
) )
} }
#[inline] #[inline]
pub(crate) fn variable_set<S: BuildHasher>( pub(crate) fn variable_set<S: BuildHasher>(
&mut self, &mut self,