iwasm fails to handle a valid WebAssembly module involving the type section, causing a segmentation fault.
Test case
(module
(type (;0;) (struct (field i32) (field funcref)))
(type (;1;) (func (result i32)))
(global (;0;) (ref 0) i32.const 42 ref.null func struct.new 0)
(export "run" (func 0))
(func (;0;) (type 1) (result i32)
global.get 0
struct.get 0 0
)
)
typesection.wasm.txt
Environment
- OS: Ubuntu 20.04
- CPU: amd64
- iwasm version:
c46b10dc
- Commands:
wasm-micro-runtime/product-mini/platforms/linux/build/iwasm --interp -f run test.wasm
Actual behavior
Segmentation fault (core dumped)