mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Wasm: adjust function indices for preloading
This commit is contained in:
parent
9f0e0d5099
commit
9f8f31b2b6
2 changed files with 10 additions and 5 deletions
|
@ -539,14 +539,16 @@ impl<'a> WasmBackend<'a> {
|
|||
CallConv::C,
|
||||
);
|
||||
|
||||
for (func_index, (ir_sym, linker_sym_index)) in
|
||||
for (roc_proc_index, (ir_sym, linker_sym_index)) in
|
||||
self.proc_symbols.iter().enumerate()
|
||||
{
|
||||
let wasm_fn_index =
|
||||
self.module.code.preloaded_count + roc_proc_index as u32;
|
||||
if ir_sym == func_sym {
|
||||
let num_wasm_args = param_types.len();
|
||||
let has_return_val = ret_type.is_some();
|
||||
self.code_builder.call(
|
||||
func_index as u32,
|
||||
wasm_fn_index,
|
||||
*linker_sym_index,
|
||||
num_wasm_args,
|
||||
has_return_val,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue