Skip to content

Commit

Permalink
Fix fuzzer and bench build
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Oct 6, 2024
1 parent 2ff2b32 commit d495f3e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/wasmparser/benches/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,24 @@ fn read_all_wasm(wasm: &[u8]) -> Result<()> {
| CustomSection { .. }
| CodeSectionStart { .. }
| End(_) => {}

other => {
// NB: if you hit this panic if you'd be so kind as to grep
// through other locations in the code base that need to be
// updated as well. As of the time of this writing the locations
// might be:
//
// * src/bin/wasm-tools/objdump.rs
// * src/bin/wasm-tools/dump.rs
// * crates/wasm-encoder/src/reencode.rs
// * crates/wasm-encoder/src/reencode/component.rs
// * crates/wasmprinter/src/lib.rs
// * crates/wit-component/src/gc.rs
//
// This is required due to the `#[non_exhaustive]` nature of
// the `Payload` enum.
panic!("a new match statement should be added above for this case: {other:?}")
}
}
}
Ok(())
Expand Down
2 changes: 2 additions & 0 deletions fuzz/src/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ fn validate_all(u: &mut Unstructured<'_>, mut validator: Validator, wasm: &[u8])

// No associated range.
End(_) => {}

_ => {}
}
}

Expand Down

0 comments on commit d495f3e

Please sign in to comment.