Add fuzz target to fuzz wasm-to-IR conversion.

This commit is contained in:
Chris Fallin 2021-11-13 14:31:11 -08:00
parent bc245b581a
commit 16a645e69b
3 changed files with 40 additions and 0 deletions

4
fuzz/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
target
corpus
artifacts

27
fuzz/Cargo.toml Normal file
View 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

View 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();
});