A few more small fuzzing fixes (#2770)
* Increase allowances for values when fuzzing The wasm-smith limits for generating modules are a bit higher than what we specify, so sync those up to avoid getting too many false positives with limits getting blown. * Ensure fuzzing `*.wat` files are in sync I keep looking at `*.wat` files that are actually stale, so remove stale files if we write out a `*.wasm` file and can't disassemble it. * Enable shadowing in dummy_linker Fixes an issues where the same name is imported twice and we generated two values for that. We don't mind the error here, we just want to ignore the shadowing errors.
This commit is contained in:
@@ -34,9 +34,13 @@ fn log_wasm(wasm: &[u8]) {
|
||||
let name = format!("testcase{}.wasm", i);
|
||||
std::fs::write(&name, wasm).expect("failed to write wasm file");
|
||||
log::debug!("wrote wasm file to `{}`", name);
|
||||
if let Ok(s) = wasmprinter::print_bytes(wasm) {
|
||||
let name = format!("testcase{}.wat", i);
|
||||
std::fs::write(&name, s).expect("failed to write wat file");
|
||||
let wat = format!("testcase{}.wat", i);
|
||||
match wasmprinter::print_bytes(wasm) {
|
||||
Ok(s) => std::fs::write(&wat, s).expect("failed to write wat file"),
|
||||
// If wasmprinter failed remove a `*.wat` file, if any, to avoid
|
||||
// confusing a preexisting one with this wasm which failed to get
|
||||
// printed.
|
||||
Err(_) => drop(std::fs::remove_file(&wat)),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user