Recent changes to fuzzers made expectations more strict about handling errors while fuzzing, but this erroneously changed a module compilation step to always assume that the input wasm is valid. Instead a flag is now passed through indicating whether the wasm blob is known valid or invalid, and only if compilation fails and it's known valid do we panic.
14 lines
328 B
Rust
14 lines
328 B
Rust
#![no_main]
|
|
|
|
use libfuzzer_sys::fuzz_target;
|
|
use wasm_smith::Module;
|
|
use wasmtime::Strategy;
|
|
use wasmtime_fuzzing::oracles;
|
|
|
|
fuzz_target!(|module: Module| {
|
|
let mut module = module;
|
|
module.ensure_termination(1000);
|
|
let wasm_bytes = module.to_bytes();
|
|
oracles::instantiate(&wasm_bytes, true, Strategy::Auto);
|
|
});
|