Wasm: adjust dead code elimination to account for import function indices

This commit is contained in:
Brian Carroll 2022-01-12 09:31:00 +00:00
parent ca2597973e
commit 9dabc2db15
5 changed files with 124 additions and 61 deletions

View file

@ -119,9 +119,11 @@ impl<'a> WasmBackend<'a> {
pub fn into_module(mut self, remove_dead_preloads: bool) -> WasmModule<'a> {
if remove_dead_preloads {
self.module
.code
.remove_dead_preloads(self.env.arena, self.called_preload_fns)
self.module.code.remove_dead_preloads(
self.env.arena,
self.module.import.function_count,
self.called_preload_fns,
)
}
self.module
}