Expand modules instantiated in instantiate-wasm-smith

This commit uses the new `MaybeInvalidModule` type in `wasm-smith` to
try to explore more points in the fuzz target space in the
`instantiate-maybe-invalid` fuzz target. The goal here is to use the raw
fuzz input as the body of a function to stress the validator/decoder a
bit more, and try to get inputs we might not otherwise generate.
This commit is contained in:
Alex Crichton
2020-09-03 07:23:33 -07:00
parent 2ef78d0a88
commit 38428e1fbb
5 changed files with 31 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ target-lexicon = "0.10"
peepmatic-fuzzing = { path = "../cranelift/peepmatic/crates/fuzzing", optional = true }
wasmtime = { path = "../crates/wasmtime" }
wasmtime-fuzzing = { path = "../crates/fuzzing" }
wasm-smith = "0.1.3"
wasm-smith = "0.1.5"
[[bin]]
name = "compile"

View File

@@ -0,0 +1,15 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use std::time::Duration;
use wasm_smith::Module;
use wasmtime::Strategy;
use wasmtime_fuzzing::oracles;
fuzz_target!(|module: MaybeInvalidModule| {
oracles::instantiate_with_config(
&module.to_bytes(),
wasmtime_fuzzing::fuzz_default_config(Strategy::Auto),
Some(Duration::from_secs(20)),
);
});