Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Fix writing the json configuration file in fuzzing (#14262)

Alex Crichtonc4a69bbf7dec
diff --git a/crates/fuzzing/src/generators/module.rs b/crates/fuzzing/src/generators/module.rs
index ce164149cd..e9d602f36e 100644
--- a/crates/fuzzing/src/generators/module.rs
+++ b/crates/fuzzing/src/generators/module.rs
@@ -126,17 +126,17 @@ impl ModuleConfig {
config.limit_arrays_in_const_exprs = true;
}
- let mut module = wasm_smith::Module::new(config, input)?;
+ let mut module = wasm_smith::Module::new(config.clone(), input)?;
if let Some(before) = input_before {
static GEN_CNT: AtomicUsize = AtomicUsize::new(0);
let used = before.len() - input.len();
let i = GEN_CNT.fetch_add(1, Relaxed);
let dna = format!("testcase{i}.dna");
- let config = format!("testcase{i}.json");
- log::debug!("writing `{dna}` and `{config}`");
+ let config_file = format!("testcase{i}.json");
+ log::debug!("writing `{dna}` and `{config_file}`");
std::fs::write(&dna, &before[..used]).unwrap();
- std::fs::write(&config, serde_json::to_string_pretty(&config).unwrap()).unwrap();
+ std::fs::write(&config_file, serde_json::to_string_pretty(&config).unwrap()).unwrap();
}
if let Some(default_fuel) = default_fuel {