|
|
@@ -112,6 +112,9 @@ wasm_init_table(WASMModuleInstance *inst, uint32 tbl_idx, uint32 elem_idx,
|
|
|
if (bh_bitmap_get_bit(inst->e->common.elem_dropped, elem_idx))
|
|
|
goto out_of_bounds;
|
|
|
|
|
|
+ if (!wasm_elem_is_passive(inst->module->table_segments[elem_idx].mode))
|
|
|
+ goto out_of_bounds;
|
|
|
+
|
|
|
bh_memcpy_s((uint8 *)tbl + offsetof(WASMTableInstance, elems)
|
|
|
+ dst_offset * sizeof(uint32),
|
|
|
(uint32)((tbl_sz - dst_offset) * sizeof(uint32)),
|