mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-04 18:10:18 +00:00
Fuzz all the backends.
This commit is contained in:
parent
38f4fdb195
commit
6370e11034
@ -12,6 +12,8 @@ cargo-fuzz = true
|
||||
wasmer-runtime = { path = "../lib/runtime" }
|
||||
wasmer-runtime-core = { path = "../lib/runtime-core" }
|
||||
wasmer = { path = "../" }
|
||||
wasmer-llvm-backend = { path = "../lib/llvm-backend" }
|
||||
wasmer-singlepass-backend = { path = "../lib/singlepass-backend" }
|
||||
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" }
|
||||
|
||||
# Prevent this from interfering with workspaces
|
||||
|
@ -2,9 +2,24 @@
|
||||
#[macro_use]
|
||||
extern crate libfuzzer_sys;
|
||||
extern crate wasmer_runtime;
|
||||
extern crate wasmer_runtime_core;
|
||||
extern crate wasmer_llvm_backend;
|
||||
extern crate wasmer_singlepass_backend;
|
||||
|
||||
use wasmer_runtime::compile;
|
||||
use wasmer_runtime::{compile, compile_with};
|
||||
use wasmer_runtime_core::backend::Compiler;
|
||||
|
||||
fn get_llvm_compiler() -> impl Compiler {
|
||||
use wasmer_llvm_backend::LLVMCompiler;
|
||||
LLVMCompiler::new()
|
||||
}
|
||||
fn get_singlepass_compiler() -> impl Compiler {
|
||||
use wasmer_singlepass_backend::SinglePassCompiler;
|
||||
SinglePassCompiler::new()
|
||||
}
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let _ = compile_with(data, &get_llvm_compiler());
|
||||
let _ = compile(data);
|
||||
let _ = compile_with(data, &get_singlepass_compiler());
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user