A passive data / element segment that has been data.drop / elem.drop'd has length 0. An array.new_data / array.new_elem with offset 0 and size 0 is in bounds (0 + 0 <= 0) and must produce an empty array, not trap. Wizard traps MEMORY_OOB.
Repro
(module
(data $d "ab")
(type $a (array (mut i8)))
(func (export "f") (result i32)
(data.drop $d)
(drop (array.new_data $a $d (i32.const 0) (i32.const 0))) ;; in bounds: a zero-length array
(i32.const 33)))
wasm-tools, wasmtime, WasmEdge and V8 accept and return 33; Wizard traps MEMORY_OOB.
The parallel array.new_elem from a dropped passive element segment behaves the same. A non-dropped size-0 array.new_data succeeds on Wizard too, so it is specifically the dropped-segment + size-0 combination — the dropped segment should be treated as a zero-length segment, leaving a size-0 access in bounds.
A passive data / element segment that has been
data.drop/elem.drop'd has length 0. Anarray.new_data/array.new_elemwith offset 0 and size 0 is in bounds (0 + 0 <= 0) and must produce an empty array, not trap. Wizard trapsMEMORY_OOB.Repro
wasm-tools, wasmtime, WasmEdge and V8 accept and return 33; Wizard traps
MEMORY_OOB.The parallel
array.new_elemfrom a dropped passive element segment behaves the same. A non-dropped size-0array.new_datasucceeds on Wizard too, so it is specifically the dropped-segment + size-0 combination — the dropped segment should be treated as a zero-length segment, leaving a size-0 access in bounds.