add bounds checks for stackless iterator (#2110)
This commit is contained in:
@@ -280,11 +280,13 @@ impl<'a, UMP: UnmarkPolicy> StacklessPreOrderHeapIter<'a, UMP> {
|
||||
return Some(cell);
|
||||
}
|
||||
|
||||
if self.next < self.heap.len() as u64 {
|
||||
if self.heap[self.next as usize].get_mark_bit() == self.iter_state.mark_phase() {
|
||||
let tag = HeapCellValueTag::AttrVar;
|
||||
return Some(HeapCellValue::build_with(tag, next));
|
||||
}
|
||||
}
|
||||
}
|
||||
HeapCellValueTag::Var => {
|
||||
let next = self.next;
|
||||
let current = self.current;
|
||||
@@ -297,11 +299,13 @@ impl<'a, UMP: UnmarkPolicy> StacklessPreOrderHeapIter<'a, UMP> {
|
||||
return Some(cell);
|
||||
}
|
||||
|
||||
if self.next < self.heap.len() as u64 {
|
||||
if self.heap[self.next as usize].get_mark_bit() == self.iter_state.mark_phase() {
|
||||
let tag = HeapCellValueTag::Var;
|
||||
return Some(HeapCellValue::build_with(tag, next));
|
||||
}
|
||||
}
|
||||
}
|
||||
HeapCellValueTag::Str => {
|
||||
if self.heap[self.next as usize + 1].get_forwarding_bit() {
|
||||
self.iter_state.cycle_detected();
|
||||
|
||||
Reference in New Issue
Block a user