mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Wasm: store function_count on the ImportSection
This commit is contained in:
parent
7a4593170c
commit
ca2597973e
3 changed files with 25 additions and 8 deletions
|
@ -96,8 +96,7 @@ pub fn build_module_help<'a>(
|
|||
let initial_module = WasmModule::preload(env.arena, preload_bytes);
|
||||
|
||||
// Adjust Wasm function indices to account for functions from the object file
|
||||
let runtime_import_fn_count: u32 = initial_module.import.function_count(); // to be imported at runtime (e.g. WASI)
|
||||
let fn_index_offset: u32 = runtime_import_fn_count + initial_module.code.preloaded_count;
|
||||
let fn_index_offset: u32 = initial_module.import.function_count + initial_module.code.preloaded_count;
|
||||
|
||||
// Get a map of name to index for the preloaded functions
|
||||
// Assumes the preloaded object file has all symbols exported, as per `zig build-lib -dymamic`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue