Skip to content

Commit

Permalink
Update wasmparser (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffcharles authored Jun 3, 2024
1 parent a72f085 commit 2fdf044
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ lazy_static = "1.4"
serde = { version = "1.0", default-features = false, features = ["derive"] }
criterion = "0.5"
num-format = "0.4.4"
wasmparser = "0.206.0"
wasmparser = "0.209.1"

[build-dependencies]
anyhow = "1.0.81"
Expand Down
13 changes: 7 additions & 6 deletions crates/cli/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use anyhow::Result;
use std::path::{Path, PathBuf};
use wasmparser::ProducersSectionReader;
use wasmtime::{Engine, Module};

// Allows dead code b/c each integration test suite is considered its own
Expand All @@ -25,13 +24,15 @@ pub fn create_quickjs_provider_module(engine: &Engine) -> Result<Module> {
pub fn assert_producers_section_is_correct(wasm: &[u8]) -> Result<()> {
let producers_section = wasmparser::Parser::new(0)
.parse_all(wasm)
.find_map(|payload| match payload {
Ok(wasmparser::Payload::CustomSection(c)) if c.name() == "producers" => {
Some(ProducersSectionReader::new(c.data(), c.data_offset()).unwrap())
.find_map(|payload| {
if let Ok(wasmparser::Payload::CustomSection(c)) = payload {
if let wasmparser::KnownCustom::Producers(r) = c.as_known() {
return Some(r);
}
}
_ => None,
None
})
.unwrap();
.expect("Should have producers custom section");
let fields = producers_section
.into_iter()
.collect::<Result<Vec<_>, _>>()?;
Expand Down

0 comments on commit 2fdf044

Please sign in to comment.