diff --git a/.gitignore b/.gitignore index 2899a68c..7378fc32 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,6 @@ specification/cheatsheet.log specification/cheatsheet.synctex.gz triton-vm/proofs/* -# Ignore proptest-regression processor file caused by bug -triton-air/proptest-regressions/table/processor.txt - triton-isa/proptest-regressions/op_stack.txt +# Ignore proptest-regression files caused by bug +triton-air/proptest-regressions/table/* +triton-isa/proptest-regressions/* diff --git a/triton-isa/proptest-regressions/op_stack.txt b/triton-isa/proptest-regressions/op_stack.txt deleted file mode 100644 index d81589e5..00000000 --- a/triton-isa/proptest-regressions/op_stack.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Seeds for failure cases proptest has generated in the past. It is -# automatically read and these particular cases re-run before any -# novel cases are generated. -# -# It is recommended to check this file in to source control so that -# everyone who runs the test benefits from these saved cases. -cc 1aba9848f7ed5ca8eadafb158a8556f275347643f66c593835cdcf8f0d65f2de # shrinks to input = _RemovingAnElementFromTheStackRemovesTheCorrectElementArgs { removal_index: ST0 } -cc 576ed2bf621f2eee2d85b258a07bb4a20ef2c5d646ddaf4f970bff3fba1a6bdf # shrinks to input = _InsertingAnElementIntoTheStackPutsItAtTheCorrectPositionArgs { insertion_index: ST0, insertion_element: BFieldElement(0) } -cc b51d5062351be8a8060741fa637009e4fb11553a67a5c29ff10fece1e1e9d743 # shrinks to input = _InvalidU32sCannotBeRetrievedAsU32sArgs { st: ST7, non_u32: 4294967296 } diff --git a/triton-isa/src/instruction.rs b/triton-isa/src/instruction.rs index fa6f65a7..4313d6c2 100644 --- a/triton-isa/src/instruction.rs +++ b/triton-isa/src/instruction.rs @@ -834,8 +834,8 @@ pub enum InstructionError { #[error("Triton VM has halted and cannot execute any further instructions")] MachineHalted, - #[error(transparent)] - OpStackError(#[from] OpStackError), + #[error(transparent)] + OpStackError(#[from] OpStackError), } #[cfg(test)] diff --git a/triton-isa/src/op_stack.rs b/triton-isa/src/op_stack.rs index d67ba6f1..7862d5ba 100644 --- a/triton-isa/src/op_stack.rs +++ b/triton-isa/src/op_stack.rs @@ -55,8 +55,8 @@ pub enum OpStackError { #[error("failed to convert BFieldElement {0} into u32")] FailedU32Conversion(BFieldElement), - #[error("index {0} is out of range for OpStack")] - IndexOutOfBounds(usize), + #[error("index {0} is out of range for OpStack")] + IndexOutOfBounds(usize), } impl OpStack { diff --git a/triton-isa/src/parser.rs b/triton-isa/src/parser.rs index 19723d64..92532e7e 100644 --- a/triton-isa/src/parser.rs +++ b/triton-isa/src/parser.rs @@ -1,12 +1,5 @@ #![allow(clippy::needless_lifetimes)] #![allow(elided_named_lifetimes)] -use std::collections::hash_map::Entry; -use std::collections::HashMap; -use std::collections::HashSet; -use std::error::Error; -use std::fmt::Display; -use std::fmt::Formatter; -use std::fmt::Result as FmtResult; use nom::branch::alt; use nom::bytes::complete::tag; use nom::bytes::complete::take_while; @@ -23,6 +16,13 @@ use nom::multi::many0; use nom::multi::many1; use nom::Finish; use nom::IResult; +use std::collections::hash_map::Entry; +use std::collections::HashMap; +use std::collections::HashSet; +use std::error::Error; +use std::fmt::Display; +use std::fmt::Formatter; +use std::fmt::Result as FmtResult; use twenty_first::bfe; use twenty_first::prelude::BFieldElement; @@ -35,7 +35,6 @@ use crate::instruction::ALL_INSTRUCTION_NAMES; use crate::op_stack::NumberOfWords; use crate::op_stack::OpStackElement; - #[derive(Debug, PartialEq)] pub struct ParseError<'a> { pub input: &'a str, diff --git a/triton-vm/src/vm.rs b/triton-vm/src/vm.rs index cb0b1e98..35bc16f1 100644 --- a/triton-vm/src/vm.rs +++ b/triton-vm/src/vm.rs @@ -494,7 +494,7 @@ impl VMState { Ok(vec![]) } - fn pick(&mut self, stack_register: OpStackElement) -> InstructionResult>{ + fn pick(&mut self, stack_register: OpStackElement) -> InstructionResult> { let element = self.op_stack.remove(stack_register)?; self.op_stack.push(element); self.instruction_pointer += 2;