Skip to content

Commit

Permalink
Cover streamed translation in translation fuzzer (#1251)
Browse files Browse the repository at this point in the history
* cover streamed translation in fuzzer

* disable MSRV CI check for fuzz crate

the fuzz targets require nightly Rust anyways

* fix exclusion crate name
  • Loading branch information
Robbepop authored Oct 25, 2024
1 parent fc4e556 commit a1daace
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v2
- run: cargo check --workspace
- run: cargo check --workspace --exclude wasmi_fuzz

test:
name: Test
Expand Down
9 changes: 8 additions & 1 deletion fuzz/fuzz_targets/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@ fuzz_target!(|seed: &[u8]| {
let Ok(consume_fuel) = bool::arbitrary(&mut u) else {
return;
};
let Ok(streaming) = bool::arbitrary(&mut u) else {
return;
};
let Ok(smith_module) = arbitrary_swarm_config_module(&mut u) else {
return;
};
let wasm = smith_module.to_bytes();
let mut config = Config::default();
config.consume_fuel(consume_fuel);
let engine = Engine::new(&config);
Module::new(&engine, &wasm[..]).unwrap();
let make_module = match streaming {
true => Module::new_streaming,
false => Module::new,
};
make_module(&engine, &wasm[..]).unwrap();
});

0 comments on commit a1daace

Please sign in to comment.