mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Wasm: adjust dead code elimination to account for import function indices
This commit is contained in:
parent
ca2597973e
commit
9dabc2db15
5 changed files with 124 additions and 61 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue