wabt icon indicating copy to clipboard operation
wabt copied to clipboard

Missing Validation for catch_all Instruction

Open Q1IQ opened this issue 1 year ago • 1 comments

wasm-interp does not enforce the requirement that a catch block must be associated with a try block.

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

No validation error is produced.

Expected Behavior

According to the WebAssembly exception handling proposal, a catch block must be directly associated with a try block. If not, the module should fail validation with an error similar to:

catch block isn't associated to a try

Q1IQ avatar Jan 08 '25 13:01 Q1IQ

EHv3 is deprecated and will be removed some time in the future, the interpreter supports EHv4 these days.

SoniEx2 avatar Jan 08 '25 18:01 SoniEx2