Skip to content

Commit

Permalink
end_addr max value check
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Jan 9, 2025
1 parent d921ce9 commit 7f52102
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stwo_cairo_prover/crates/prover/src/input/vm_import/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use super::builtin_segments::BuiltinSegments;
use super::memory::MemoryConfig;
use super::state_transitions::StateTransitions;
use super::ProverInput;
use crate::components::memory::MEMORY_ADDRESS_BOUND;
use crate::input::memory::MemoryBuilder;

#[derive(Debug, Error)]
Expand Down Expand Up @@ -46,7 +47,7 @@ pub fn adapt_vm_output(
.map(|v| v.stop_ptr)
.max()
.ok_or(VmImportError::NoMemorySegments)?;
assert!(end_addr < 1 << (usize::BITS - 1));
assert!(end_addr < MEMORY_ADDRESS_BOUND);

let memory_path = private_input_json
.parent()
Expand Down

0 comments on commit 7f52102

Please sign in to comment.