binaryen
binaryen copied to clipboard
[Question] How to do type evaluation in Binaryen?
Hi, I found that when I use WasmBinaryReader
to parse a type-mismatched wasm
file, it would not raise error messages. So I just wonder could I do the type evaluation in Binaryen? i.e., Simulate execution on an abstract stack to determine whether there is a type mismatch. Thank you!
(; example of type-mismatched code ;)
global.get 0
i32.const 32
i64.sub
To check if the module is valid you also need to run validation,
https://github.com/WebAssembly/binaryen/blob/main/src/wasm-validator.h