waffle/fuzz/fuzz_targets/roundtrip.rs

13 lines
358 B
Rust
Raw Normal View History

2021-11-14 02:00:34 -06:00
#![no_main]
use libfuzzer_sys::fuzz_target;
use waffle::Module;
fuzz_target!(|module: wasm_smith::Module| {
let _ = env_logger::try_init();
2021-11-20 14:20:34 -06:00
log::debug!("original module: {:?}", module);
2021-11-14 02:00:34 -06:00
let orig_bytes = module.to_bytes();
let parsed_module = Module::from_wasm_bytes(&orig_bytes[..]).unwrap();
let _ = parsed_module.to_wasm_bytes();
});