limit use of stackless iterator to test suite

This commit is contained in:
Mark Thom
2022-04-05 21:02:39 -06:00
parent f3167f6b5f
commit 3b6138eaaa
3 changed files with 8 additions and 3 deletions

View File

@@ -1098,7 +1098,7 @@ impl MachineState {
pub(crate) fn arith_eval_by_metacall(&mut self, value: HeapCellValue) -> Result<Number, MachineStub> {
let stub_gen = || functor_stub(atom!("is"), 2);
let mut iter = stackless_post_order_iter(&mut self.heap, value);
let mut iter = stackful_post_order_iter(&mut self.heap, value);
while let Some(value) = iter.next() {
if value.get_forwarding_bit() {
@@ -1125,8 +1125,8 @@ impl MachineState {
read_heap_cell!(value,
(HeapCellValueTag::Atom, (name, arity)) => {
if arity == 2 {
let a1 = self.interms.pop().unwrap();
let a2 = self.interms.pop().unwrap();
let a1 = self.interms.pop().unwrap();
match name {
atom!("+") => self.interms.push(drop_iter_on_err!(

View File

@@ -104,6 +104,7 @@ impl<'a> StacklessPreOrderHeapIter<'a, MarkerUMP> {
}
impl<'a> StacklessPreOrderHeapIter<'a, IteratorUMP> {
#[cfg(test)]
pub(crate) fn new(heap: &'a mut Vec<HeapCellValue>, cell: HeapCellValue) -> Self {
let orig_heap_len = heap.len();
let start = orig_heap_len + 1;