Update the walrus dependency (#2125)

This commit updates the `walrus` crate used in `wasm-bindgen`. The major
change here is how `walrus` handles element segments, exposing segments
rather than trying to keep a contiugous array of all the elements and
doing the splitting itself. That means that we need to do mroe logic
here in `wasm-bindgen` to juggle indices, segments, etc.
This commit is contained in:
Alex Crichton
2020-05-06 12:57:02 -05:00
committed by GitHub
parent dc54c0fb25
commit 8e3d6fe619
20 changed files with 242 additions and 120 deletions

View File

@ -24,7 +24,7 @@ rouille = { version = "3.0.0", default-features = false }
serde = { version = "1.0", features = ['derive'] }
serde_derive = "1.0"
serde_json = "1.0"
walrus = { version = "0.14.0", features = ['parallel'] }
walrus = { version = "0.16.0", features = ['parallel'] }
wasm-bindgen-cli-support = { path = "../cli-support", version = "=0.2.62" }
wasm-bindgen-shared = { path = "../shared", version = "=0.2.62" }
@ -34,11 +34,11 @@ diff = "0.1"
predicates = "1.0.0"
rayon = "1.0"
tempfile = "3.0"
walrus = "0.14"
walrus = "0.16"
wit-printer = "0.1"
wit-text = "0.1"
wit-validator = "0.1"
wit-walrus = "0.1"
wit-walrus = "0.2"
[[test]]
name = "reference"

View File

@ -152,6 +152,13 @@ fn sanitize_wasm(wasm: &Path) -> Result<String> {
for mem in module.memories.iter_mut() {
mem.data_segments.drain();
}
let ids = module.elements.iter().map(|d| d.id()).collect::<Vec<_>>();
for id in ids {
module.elements.delete(id);
}
for table in module.tables.iter_mut() {
table.elem_segments.drain();
}
let ids = module
.exports
.iter()