Check whether related table has funcref elem in opcode call_indirect (#3999)

* check whether table has funcref elem in call_indirect
* check whether table has funcref elem in call_indirect when gc is enabled
This commit is contained in:
TianlongLiang
2025-01-06 13:55:43 +08:00
committed by GitHub
parent 9989b1cc1b
commit a653746b7b
2 changed files with 50 additions and 0 deletions

View File

@ -6700,6 +6700,15 @@ re_scan:
goto fail;
}
bh_assert(
(table_idx < module->import_table_count
? module->import_tables[table_idx]
.u.table.table_type.elem_type
: module
->tables[table_idx - module->import_table_count]
.table_type.elem_type)
== VALUE_TYPE_FUNCREF);
#if WASM_ENABLE_FAST_INTERP != 0
/* we need to emit before arguments */
emit_uint32(loader_ctx, type_idx);