ソースを参照

Check passive mode in fast-jit table.init (#3031)

Reported in https://github.com/bytecodealliance/wasm-micro-runtime/issues/3021.
Wenyong Huang 2 年 前
コミット
b3aaf2abc0
1 ファイル変更3 行追加0 行削除
  1. 3 0
      core/iwasm/fast-jit/fe/jit_emit_table.c

+ 3 - 0
core/iwasm/fast-jit/fe/jit_emit_table.c

@@ -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)),