Wasm: Adjust funciton index for test_wrapper export declaration

This commit is contained in:
Brian Carroll 2022-01-09 16:38:23 +00:00
parent c8181c3a19
commit 4f15fb3967

View file

@ -14,7 +14,8 @@ pub trait Wasm32TestResult {
wrapper_name: &str, wrapper_name: &str,
main_function_index: u32, main_function_index: u32,
) { ) {
let index = module.code.code_builders.len() as u32; // Assumes the main function was the first one to be generated
let index = main_function_index + module.code.code_builders.len() as u32;
module.add_function_signature(Signature { module.add_function_signature(Signature {
param_types: Vec::with_capacity_in(0, arena), param_types: Vec::with_capacity_in(0, arena),