Update wasm-tools crates

Nothing major here, just a routine update with a few extra things to
handle here-and-there.
This commit is contained in:
Alex Crichton
2022-02-02 09:45:43 -08:00
parent c83968575a
commit 65486a0680
15 changed files with 102 additions and 42 deletions

View File

@@ -19,7 +19,7 @@ cranelift-codegen = { path = "../../cranelift/codegen", version = "0.80.0" }
cranelift-frontend = { path = "../../cranelift/frontend", version = "0.80.0" }
cranelift-entity = { path = "../../cranelift/entity", version = "0.80.0" }
cranelift-native = { path = "../../cranelift/native", version = "0.80.0" }
wasmparser = "0.81.0"
wasmparser = "0.82.0"
target-lexicon = "0.12"
gimli = { version = "0.26.0", default-features = false, features = ['read', 'std'] }
object = { version = "0.27.0", default-features = false, features = ['write'] }

View File

@@ -14,7 +14,7 @@ edition = "2018"
anyhow = "1.0"
cranelift-entity = { path = "../../cranelift/entity", version = "0.80.0" }
wasmtime-types = { path = "../types", version = "0.33.0" }
wasmparser = "0.81"
wasmparser = "0.82"
indexmap = { version = "1.0.2", features = ["serde-1"] }
thiserror = "1.0.4"
serde = { version = "1.0.94", features = ["derive"] }

View File

@@ -516,7 +516,12 @@ impl<'data> ModuleEnvironment<'data> {
self.result.module.table_initializers.reserve_exact(cnt);
for (index, entry) in elements.into_iter().enumerate() {
let wasmparser::Element { kind, items, ty: _ } = entry?;
let wasmparser::Element {
kind,
items,
ty: _,
range: _,
} = entry?;
// Build up a list of `FuncIndex` corresponding to all the
// entries listed in this segment. Note that it's not
@@ -646,7 +651,11 @@ impl<'data> ModuleEnvironment<'data> {
self.result.data.reserve_exact(cnt);
for (index, entry) in data.into_iter().enumerate() {
let wasmparser::Data { kind, data } = entry?;
let wasmparser::Data {
kind,
data,
range: _,
} = entry?;
let mk_range = |total: &mut u32| -> Result<_, WasmError> {
let range = u32::try_from(data.len())
.ok()

View File

@@ -13,7 +13,7 @@ arbitrary = { version = "1.0.0", features = ["derive"] }
env_logger = "0.8.1"
log = "0.4.8"
rayon = "1.2.1"
wasmparser = "0.81"
wasmparser = "0.82"
wasmprinter = "0.2.31"
wasmtime = { path = "../wasmtime" }
wasmtime-wast = { path = "../wast" }

View File

@@ -12,4 +12,4 @@ edition = "2018"
cranelift-entity = { path = "../../cranelift/entity", version = "0.80.0", features = ['enable-serde'] }
serde = { version = "1.0.94", features = ["derive"] }
thiserror = "1.0.4"
wasmparser = { version = "0.81", default-features = false }
wasmparser = { version = "0.82", default-features = false }

View File

@@ -20,7 +20,7 @@ wasmtime-cache = { path = "../cache", version = "=0.33.0", optional = true }
wasmtime-fiber = { path = "../fiber", version = "=0.33.0", optional = true }
wasmtime-cranelift = { path = "../cranelift", version = "=0.33.0", optional = true }
target-lexicon = { version = "0.12.0", default-features = false }
wasmparser = "0.81"
wasmparser = "0.82"
anyhow = "1.0.19"
region = "2.2.0"
libc = "0.2"

View File

@@ -77,6 +77,8 @@ struct WasmFeatures {
pub multi_memory: bool,
pub exceptions: bool,
pub memory64: bool,
pub relaxed_simd: bool,
pub extended_const: bool,
}
impl From<&wasmparser::WasmFeatures> for WasmFeatures {
@@ -93,20 +95,24 @@ impl From<&wasmparser::WasmFeatures> for WasmFeatures {
multi_memory,
exceptions,
memory64,
} = other;
relaxed_simd,
extended_const,
} = *other;
Self {
reference_types: *reference_types,
multi_value: *multi_value,
bulk_memory: *bulk_memory,
module_linking: *module_linking,
simd: *simd,
threads: *threads,
tail_call: *tail_call,
deterministic_only: *deterministic_only,
multi_memory: *multi_memory,
exceptions: *exceptions,
memory64: *memory64,
reference_types,
multi_value,
bulk_memory,
module_linking,
simd,
threads,
tail_call,
deterministic_only,
multi_memory,
exceptions,
memory64,
relaxed_simd,
extended_const,
}
}
}
@@ -669,6 +675,8 @@ impl<'a> SerializedModule<'a> {
multi_memory,
exceptions,
memory64,
relaxed_simd,
extended_const,
} = self.metadata.features;
Self::check_bool(
@@ -714,6 +722,16 @@ impl<'a> SerializedModule<'a> {
other.memory64,
"WebAssembly 64-bit memory support",
)?;
Self::check_bool(
extended_const,
other.extended_const,
"WebAssembly extended-const support",
)?;
Self::check_bool(
relaxed_simd,
other.relaxed_simd,
"WebAssembly relaxed-simd support",
)?;
Ok(())
}

View File

@@ -12,7 +12,7 @@ edition = "2018"
[dependencies]
anyhow = "1.0.19"
wasmtime = { path = "../wasmtime", version = "0.33.0", default-features = false, features = ['cranelift'] }
wast = "38.0.0"
wast = "39.0.0"
[badges]
maintenance = { status = "actively-developed" }

View File

@@ -4,6 +4,7 @@ use std::fmt::{Display, LowerHex};
use std::path::Path;
use std::str;
use wasmtime::*;
use wast::lexer::Lexer;
use wast::Wat;
use wast::{
parser::{self, ParseBuffer},
@@ -215,8 +216,10 @@ impl<T> WastContext<T> {
err
};
let buf = wast::parser::ParseBuffer::new(wast).map_err(adjust_wast)?;
let ast = wast::parser::parse::<wast::Wast>(&buf).map_err(adjust_wast)?;
let mut lexer = Lexer::new(wast);
lexer.allow_confusing_unicode(filename.ends_with("names.wast"));
let buf = ParseBuffer::new_with_lexer(lexer).map_err(adjust_wast)?;
let ast = parser::parse::<wast::Wast>(&buf).map_err(adjust_wast)?;
for directive in ast.directives {
let sp = directive.span();