Skip to content

Commit

Permalink
fuzz: run the GC pass when fuzzing
Browse files Browse the repository at this point in the history
When we round-trip a module through walrus, also run our GC pass on it. This
will help us catch bugs where the GC pass removes something that is actually in
use.
  • Loading branch information
fitzgen committed Sep 24, 2019
1 parent 86ae731 commit d015065
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/fuzz-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ where
}

fn round_trip_through_walrus(&self, wasm: &[u8]) -> Result<Vec<u8>> {
let module =
let mut module =
walrus::Module::from_buffer(&wasm).context("walrus failed to parse the wasm buffer")?;
walrus::passes::gc::run(&mut module);
let buf = module.emit_wasm();
Ok(buf)
}
Expand Down

0 comments on commit d015065

Please sign in to comment.