This new target compares the outputs of executing the first exported function of a Wasm module in Wasmtime and in the official Wasm spec interpreter (using the `wasm-spec-interpreter` crate). This is an initial step towards more fully-featured fuzzing (e.g. compare memories, add `v128`, add references, add other proposals, etc.)
14 lines
355 B
Rust
14 lines
355 B
Rust
#![no_main]
|
|
|
|
use libfuzzer_sys::fuzz_target;
|
|
use wasmtime_fuzzing::{generators, oracles};
|
|
|
|
fuzz_target!(|data: (
|
|
generators::Config,
|
|
wasm_smith::ConfiguredModule<oracles::SingleFunctionModuleConfig>
|
|
)| {
|
|
let (config, mut wasm) = data;
|
|
wasm.ensure_termination(1000);
|
|
oracles::differential_spec_execution(&wasm.to_bytes(), &config);
|
|
});
|