INNER CODE UNIT · Rust

peek_loop_image

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

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

        // copy all values of the stack from the last step to the current step
        for i in 0..self.loop_stack.len() {
            self.loop_stack[i][self.step] = self.loop_stack[i][self.step - 1];
        }

        // return top value of the stack
        return self.loop_stack[0][self.step];
    }

    // Removes the top value from the loop stack and returns it.
    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);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…