Skip to content

Commit 763f353

Browse files
committed
Fix writing the json configuration file in fuzzing
A mistake in the code meant that just a bland string was written out instead of the actual configuration.
1 parent e6a948e commit 763f353

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

crates/fuzzing/src/generators/module.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,17 +126,17 @@ impl ModuleConfig {
126126
config.limit_arrays_in_const_exprs = true;
127127
}
128128

129-
let mut module = wasm_smith::Module::new(config, input)?;
129+
let mut module = wasm_smith::Module::new(config.clone(), input)?;
130130

131131
if let Some(before) = input_before {
132132
static GEN_CNT: AtomicUsize = AtomicUsize::new(0);
133133
let used = before.len() - input.len();
134134
let i = GEN_CNT.fetch_add(1, Relaxed);
135135
let dna = format!("testcase{i}.dna");
136-
let config = format!("testcase{i}.json");
137-
log::debug!("writing `{dna}` and `{config}`");
136+
let config_file = format!("testcase{i}.json");
137+
log::debug!("writing `{dna}` and `{config_file}`");
138138
std::fs::write(&dna, &before[..used]).unwrap();
139-
std::fs::write(&config, serde_json::to_string_pretty(&config).unwrap()).unwrap();
139+
std::fs::write(&config_file, serde_json::to_string_pretty(&config).unwrap()).unwrap();
140140
}
141141

142142
if let Some(default_fuel) = default_fuel {

0 commit comments

Comments
 (0)