Skip to content

Commit bebdd4a

Browse files
authored
Fix aot table instantiate (#3946)
1 parent 591b740 commit bebdd4a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

core/iwasm/aot/aot_runtime.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -689,20 +689,23 @@ tables_instantiate(AOTModuleInstance *module_inst, AOTModule *module,
689689
tbl_inst->cur_size = import_table->table_type.init_size;
690690
tbl_inst->max_size =
691691
aot_get_imp_tbl_data_slots(import_table, false);
692-
tbl_inst->elem_type = module->tables[i].table_type.elem_type;
692+
tbl_inst->elem_type = import_table->table_type.elem_type;
693+
tbl_inst->is_table64 =
694+
import_table->table_type.flags & TABLE64_FLAG;
693695
#if WASM_ENABLE_GC != 0
694696
tbl_inst->elem_ref_type.elem_ref_type =
695-
module->tables[i].table_type.elem_ref_type;
697+
import_table->table_type.elem_ref_type;
696698
#endif
697699
}
698700
else {
699701
AOTTable *table = module->tables + (i - module->import_table_count);
700702
tbl_inst->cur_size = table->table_type.init_size;
701703
tbl_inst->max_size = aot_get_tbl_data_slots(table, false);
702-
tbl_inst->elem_type = module->tables[i].table_type.elem_type;
704+
tbl_inst->elem_type = table->table_type.elem_type;
705+
tbl_inst->is_table64 = table->table_type.flags & TABLE64_FLAG;
703706
#if WASM_ENABLE_GC != 0
704707
tbl_inst->elem_ref_type.elem_ref_type =
705-
module->tables[i].table_type.elem_ref_type;
708+
table->table_type.elem_ref_type;
706709
#endif
707710
}
708711

0 commit comments

Comments
 (0)