From bebdd4ad174a49005b62e4074e71cd32b05640e8 Mon Sep 17 00:00:00 2001 From: Wenyong Huang Date: Tue, 10 Dec 2024 20:26:32 +0800 Subject: [PATCH] Fix aot table instantiate (#3946) --- core/iwasm/aot/aot_runtime.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/iwasm/aot/aot_runtime.c b/core/iwasm/aot/aot_runtime.c index 8a33a727..0f7b5d3d 100644 --- a/core/iwasm/aot/aot_runtime.c +++ b/core/iwasm/aot/aot_runtime.c @@ -689,20 +689,23 @@ tables_instantiate(AOTModuleInstance *module_inst, AOTModule *module, tbl_inst->cur_size = import_table->table_type.init_size; tbl_inst->max_size = aot_get_imp_tbl_data_slots(import_table, false); - tbl_inst->elem_type = module->tables[i].table_type.elem_type; + tbl_inst->elem_type = import_table->table_type.elem_type; + tbl_inst->is_table64 = + import_table->table_type.flags & TABLE64_FLAG; #if WASM_ENABLE_GC != 0 tbl_inst->elem_ref_type.elem_ref_type = - module->tables[i].table_type.elem_ref_type; + import_table->table_type.elem_ref_type; #endif } else { AOTTable *table = module->tables + (i - module->import_table_count); tbl_inst->cur_size = table->table_type.init_size; tbl_inst->max_size = aot_get_tbl_data_slots(table, false); - tbl_inst->elem_type = module->tables[i].table_type.elem_type; + tbl_inst->elem_type = table->table_type.elem_type; + tbl_inst->is_table64 = table->table_type.flags & TABLE64_FLAG; #if WASM_ENABLE_GC != 0 tbl_inst->elem_ref_type.elem_ref_type = - module->tables[i].table_type.elem_ref_type; + table->table_type.elem_ref_type; #endif }