Skip to content

Commit

Permalink
revert kani slice size change (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft authored Jun 8, 2024
1 parent be95281 commit 6465fef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/bolero-kani/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bolero-kani"
version = "0.11.0"
version = "0.11.1"
authors = ["Cameron Bytheway <[email protected]>"]
description = "kani plugin for bolero"
homepage = "https://github.com/camshaft/bolero"
Expand Down
7 changes: 2 additions & 5 deletions lib/bolero-kani/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,13 @@ pub mod lib {

fn with_slice<F: FnMut(&[u8]) -> Output>(&mut self, f: &mut F) -> Output {
// TODO make this configurable
const MAX_LEN: usize = driver::Options::DEFAULT_MAX_LEN;
const MAX_LEN: usize = 256;

let bytes = kani::vec::any_vec::<u8, MAX_LEN>();
let len = self.options.max_len_or_default().min(MAX_LEN);
kani::assume(bytes.len() <= len);

let array: [u8; MAX_LEN] = kani::any();
let len = kani::any();
kani::assume(len <= MAX_LEN);
f(&array[..len])
f(&bytes)
}

fn with_driver<F: FnMut(&mut Self::Driver) -> Output>(&mut self, f: &mut F) -> Output {
Expand Down

0 comments on commit 6465fef

Please sign in to comment.