INNER CODE UNIT · Rust

pop_loop_image

GuildOfWeavers/distaff · src/processor/decoder/mod.rs:411

    fn pop_loop_image(&mut self) -> u128 {
        // make sure the stack is not empty
        assert!(self.loop_depth > 0, "loop stack underflow at step {}", self.step);

        // shift all stack values by one item to the left
        for i in 1..self.loop_stack.len() {
            self.loop_stack[i - 1][self.step] = self.loop_stack[i][self.step - 1];
        }

        // update the stack depth and return the value that was at the top of the stack
        // before it was shifted to the left
        self.loop_depth -= 1;
        return self.loop_stack[0][self.step - 1];
    }

    /// Copies contents of the loop stack from the previous to the current step.
    fn copy_loop_stack(&mut self) {
        for i in 0..self.loop_stack.len() {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…