Move compilation into Module from Instance. (#822)

* Move compilation into Module from Instance.

* Fix fuzzing

* Use wasmtime::Module in fuzzing crates

Instead of wasmtime_jit.

* Compile eagerly.

* Review fixes.

* Always use the saved name.

* Preserve the former behavior for fuzzing oracle
This commit is contained in:
Sergei Pepyakin
2020-01-16 23:37:10 +01:00
committed by Alex Crichton
parent e474a9e822
commit 5b8be5f262
12 changed files with 378 additions and 413 deletions

View File

@@ -1,20 +1,14 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use wasmtime::Strategy;
use wasmtime_fuzzing::{oracles, with_log_wasm_test_case};
use wasmtime_jit::CompilationStrategy;
fuzz_target!(|data: &[u8]| {
with_log_wasm_test_case!(data, |data| oracles::compile(
data,
CompilationStrategy::Cranelift
));
with_log_wasm_test_case!(data, |data| oracles::compile(data, Strategy::Cranelift));
});
#[cfg(feature = "lightbeam")]
fuzz_target!(|data: &[u8]| {
with_log_wasm_test_case!(data, |data| oracles::compile(
data,
CompilationStrategy::Lightbeam
));
with_log_wasm_test_case!(data, |data| oracles::compile(data, Strategy::Lightbeam));
});