Skip to main content

run_flat

Function run_flat 

Source
pub fn run_flat(
    program: &Program,
    input: &[u8],
    output: &mut Vec<u8>,
) -> Result<(), Error>
Expand description

Execute a program from a concatenated single-case byte payload.

Fixed-width input buffers consume exactly their declared static element count from input (count == 0 is treated as one element for legacy runtime-sized flat cases). Read-write output buffers are initialized to the same declared fixed-width storage size and appended to output after interpretation. Extra or truncated input bytes are rejected so malformed conformance vectors cannot be hidden by padding or ignored suffixes.

§Errors

Returns vyre::error::Error if the program is invalid or execution fails.

§Examples

let mut out = Vec::new();
vyre::reference::flat_cpu::run_flat(&program, &input_bytes, &mut out)?;