Skip to content
Merged
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
12 changes: 11 additions & 1 deletion core/iwasm/interpreter/wasm_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -2583,7 +2583,8 @@ load_table_import(const uint8 **p_buf, const uint8 *buf_end,
error_buf_size)) {
return false;
}
if (wasm_is_reftype_htref_non_nullable(ref_type.ref_type)) {
if (!wasm_is_type_reftype(ref_type.ref_type)
|| wasm_is_reftype_htref_non_nullable(ref_type.ref_type)) {
set_error_buf(error_buf, error_buf_size, "type mismatch");
return false;
}
Expand Down Expand Up @@ -3109,6 +3110,15 @@ load_table(const uint8 **p_buf, const uint8 *buf_end, WASMModule *module,
error_buf_size)) {
return false;
}
/*
* TODO: add this validator
* `wasm_is_reftype_htref_non_nullable(ref_type.ref_type)`
* after sync up with the latest GC spec
*/
if (!wasm_is_type_reftype(ref_type.ref_type)) {
set_error_buf(error_buf, error_buf_size, "type mismatch");
return false;
}
table->table_type.elem_type = ref_type.ref_type;
if (need_ref_type_map) {
if (!(table->table_type.elem_ref_type =
Expand Down
Loading