1
0
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-06-22 17:21:35 +00:00

Preserve the function table explicitly ()

The main gc pass of unused items in wasm-bindgen was accidentally
removing the function table because we weren't properly rooting it in
the auxiliary section which has a few ways that imports can reference
the function table via intrinsics and closures.

Closes 
This commit is contained in:
Alex Crichton
2020-01-21 13:02:13 -06:00
committed by GitHub
parent bb066e68a5
commit c5c7acc766
5 changed files with 33 additions and 1 deletions
crates
cli-support
cli
tests
wasm-bindgen

@ -2889,7 +2889,7 @@ impl<'a> Context<'a> {
}
fn export_function_table(&mut self) -> Result<String, Error> {
match self.module.tables.main_function_table()? {
match self.aux.function_table {
Some(id) => Ok(self.export_name_of(id)),
None => bail!("no function table found in module"),
}