wabt
wabt copied to clipboard
Incorrect Validation for Element Segment Initialization
wasm-interp does not correctly handle element segment initialization using global.get for non-imported globals.
Test case
program.wasm program.wasm.txt
Environment
- OS: Ubuntu 20.04
- CPU: amd64
- WABT version: 1.0.36
- Commands:
./wasm-interp --enable-all --run-export=main ./program.wasm
Actual behavior
/path/to/wabt/bin/wasm-validate --enable-all --run-export=main /path/to/test/program.wasm
error: initializer expression can only reference an imported global
Expected Behavior
Element segment offset expressions should be able to reference both imported and non-imported globals. The module should pass validation without errors.