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

@ -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()