Support extended constant expressions (#4432)

* implement extended const expr (#4318)
* add a toggle to enable extended const on wamrc (#4412)
This commit is contained in:
TianlongLiang
2025-07-07 13:34:02 +08:00
committed by GitHub
parent be33a40ba7
commit 7d05dbc988
28 changed files with 1734 additions and 379 deletions

View File

@ -5350,12 +5350,14 @@ wasm_interp_call_func_bytecode(WASMModuleInstance *module,
|| init_values[i].init_expr_type
== INIT_EXPR_TYPE_FUNCREF_CONST);
#if WASM_ENABLE_GC == 0
table_elems[i] =
(table_elem_type_t)init_values[i].u.ref_index;
table_elems[i] = (table_elem_type_t)init_values[i]
.u.unary.v.ref_index;
#else
if (init_values[i].u.ref_index != UINT32_MAX) {
if (init_values[i].u.unary.v.ref_index
!= UINT32_MAX) {
if (!(func_obj = wasm_create_func_obj(
module, init_values[i].u.ref_index,
module,
init_values[i].u.unary.v.ref_index,
true, NULL, 0))) {
goto got_exception;
}