Update fuzz crates (#826)

* deps: Update to arbitrary 0.3.x and libfuzzer-sys 0.2.0

* ci: Use cargo-fuzz 0.7.x in CI
This commit is contained in:
Nick Fitzgerald
2020-01-15 21:05:37 -08:00
committed by Alex Crichton
parent 0be3c2983c
commit adcc047f4a
6 changed files with 178 additions and 140 deletions

View File

@@ -31,13 +31,17 @@ impl fmt::Debug for WasmOptTtf {
}
impl Arbitrary for WasmOptTtf {
fn arbitrary<U>(input: &mut U) -> Result<Self, U::Error>
where
U: Unstructured + ?Sized,
{
fn arbitrary(input: &mut Unstructured) -> arbitrary::Result<Self> {
let seed: Vec<u8> = Arbitrary::arbitrary(input)?;
let module = binaryen::tools::translate_to_fuzz_mvp(&seed);
let wasm = module.write();
Ok(WasmOptTtf { wasm })
}
fn arbitrary_take_rest(input: Unstructured) -> arbitrary::Result<Self> {
let seed: Vec<u8> = Arbitrary::arbitrary_take_rest(input)?;
let module = binaryen::tools::translate_to_fuzz_mvp(&seed);
let wasm = module.write();
Ok(WasmOptTtf { wasm })
}
}