Add fuzz target to fuzz wasm-to-IR conversion.
This commit is contained in:
parent
bc245b581a
commit
16a645e69b
4
fuzz/.gitignore
vendored
Normal file
4
fuzz/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
target
|
||||
corpus
|
||||
artifacts
|
27
fuzz/Cargo.toml
Normal file
27
fuzz/Cargo.toml
Normal file
|
@ -0,0 +1,27 @@
|
|||
|
||||
[package]
|
||||
name = "waffle-fuzz"
|
||||
version = "0.0.0"
|
||||
authors = ["Automatically generated"]
|
||||
publish = false
|
||||
edition = "2018"
|
||||
|
||||
[package.metadata]
|
||||
cargo-fuzz = true
|
||||
|
||||
[dependencies]
|
||||
libfuzzer-sys = "0.3"
|
||||
wasm-smith = "0.8"
|
||||
|
||||
[dependencies.waffle]
|
||||
path = ".."
|
||||
|
||||
# Prevent this from interfering with workspaces
|
||||
[workspace]
|
||||
members = ["."]
|
||||
|
||||
[[bin]]
|
||||
name = "parse_ir"
|
||||
path = "fuzz_targets/parse_ir.rs"
|
||||
test = false
|
||||
doc = false
|
9
fuzz/fuzz_targets/parse_ir.rs
Normal file
9
fuzz/fuzz_targets/parse_ir.rs
Normal file
|
@ -0,0 +1,9 @@
|
|||
#![no_main]
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
|
||||
use waffle::frontend::wasm_to_ir;
|
||||
use wasm_smith::Module;
|
||||
|
||||
fuzz_target!(|module: Module| {
|
||||
let _parsed_module = wasm_to_ir(module.to_bytes()).unwrap();
|
||||
});
|
Loading…
Reference in a new issue