Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions core/iwasm/interpreter/wasm_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ is_table_64bit(WASMModule *module, uint32 table_idx)
return !!(module->import_tables[table_idx].u.table.table_type.flags
& TABLE64_FLAG);
else
return !!(module->tables[table_idx].table_type.flags & TABLE64_FLAG);
return !!(module->tables[table_idx - module->import_table_count]
.table_type.flags
& TABLE64_FLAG);

return false;
}
Expand Down Expand Up @@ -4282,7 +4284,8 @@ check_table_elem_type(WASMModule *module, uint32 table_index,
module->import_tables[table_index].u.table.table_type.elem_type;
else
table_declared_elem_type =
(module->tables + table_index)->table_type.elem_type;
module->tables[table_index - module->import_table_count]
.table_type.elem_type;

if (table_declared_elem_type == type_from_elem_seg)
return true;
Expand Down Expand Up @@ -10837,12 +10840,12 @@ get_table_elem_type(const WASMModule *module, uint32 table_idx,
else {
if (p_elem_type)
*p_elem_type =
module->tables[module->import_table_count + table_idx]
module->tables[table_idx - module->import_table_count]
.table_type.elem_type;
#if WASM_ENABLE_GC != 0
if (p_ref_type)
*((WASMRefType **)p_ref_type) =
module->tables[module->import_table_count + table_idx]
module->tables[table_idx - module->import_table_count]
.table_type.elem_ref_type;
#endif
}
Expand Down
6 changes: 4 additions & 2 deletions core/iwasm/interpreter/wasm_mini_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ is_table_64bit(WASMModule *module, uint32 table_idx)
return !!(module->import_tables[table_idx].u.table.table_type.flags
& TABLE64_FLAG);
else
return !!(module->tables[table_idx].table_type.flags & TABLE64_FLAG);
return !!(module->tables[table_idx - module->import_table_count]
.table_type.flags
& TABLE64_FLAG);

return false;
}
Expand Down Expand Up @@ -2566,7 +2568,7 @@ get_table_elem_type(const WASMModule *module, uint32 table_idx,
module->import_tables[table_idx].u.table.table_type.elem_type;
else
*p_elem_type =
module->tables[module->import_table_count + table_idx]
module->tables[table_idx - module->import_table_count]
.table_type.elem_type;
}
return true;
Expand Down
Loading