INNER CODE UNIT · Rust
copy_context_stack
GuildOfWeavers/distaff · src/processor/decoder/mod.rs:365
fn copy_context_stack(&mut self) {
for i in 0..self.ctx_stack.len() {
self.ctx_stack[i][self.step] = self.ctx_stack[i][self.step - 1];
}
}
// LOOP STACK HELPERS
// --------------------------------------------------------------------------------------------
/// Pushes `loop_image` onto the loop stack.
fn save_loop_image(&mut self, loop_image: u128) {
// increment loop depth and make sure it doesn't overflow the stack
self.loop_depth += 1;
assert!(self.loop_depth <= MAX_LOOP_DEPTH, "loop stack overflow at step {}", self.step);
// if the depth exceeds current number of registers allocated for the loop stack,
// add a new register trace to the stack
if self.loop_depth > self.loop_stack.len() {