Skip to content

Commit 71c4990

Browse files
authored
Fix roundtrip-wit fuzzer's detection of cases to throw out (#949)
This fixes some fuzz bugs that have been cropping up since #946.
1 parent cfc1d60 commit 71c4990

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fuzz/fuzz_targets/roundtrip-wit.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fuzz_target!(|data: &[u8]| {
2525
Ok(id) => id,
2626
Err(e) => {
2727
let err = e.to_string();
28-
if err.contains("conflicts with a previously")
28+
if err.contains("conflicts with a previous")
2929
|| err.contains("shadows previously imported")
3030
{
3131
return;
@@ -440,7 +440,6 @@ mod generate {
440440
}
441441

442442
let mut parts = Vec::new();
443-
let mut exports = HashSet::new();
444443
let mut imported_interfaces = HashSet::new();
445444
let mut exported_interfaces = HashSet::new();
446445

@@ -456,7 +455,7 @@ mod generate {
456455
let mut part = String::new();
457456
let name = match direction {
458457
Some(Direction::Import) | None => gen_unique_name(u, &mut self.unique_names)?,
459-
Some(Direction::Export) => gen_unique_name(u, &mut exports)?,
458+
Some(Direction::Export) => gen_unique_name(u, &mut self.unique_names)?,
460459
};
461460
if let Some(dir) = direction {
462461
part.push_str(match dir {

0 commit comments

Comments
 (0)