Skip to content

Commit 11d3c76

Browse files
committed
[WebAssembly] Allow AsmTypeCheck detect multiple errors in function
This allows multiple errors to be reported within a function, rather than returning on the first error and not looking at the rest of the function. I think the rationale for the previous behavior was that upon encountering the first error, the value stack was not in the correct status anymore and the rest of the function checking was not very meaningful. But this patch makes the instruction push the correct result type upon its completion, so the while the possibility of previous error affecting later instructions is not zero, I think this can be more helpful to assembly hand-writers. This also allows us to write multiple error test cases without creating as many functions. This is what Wabt and Binaryen wast parsers do as well. Also this makes sure we return a value (true/false) within an `if` for each instruction, removing the need for the long `if`-`else if`- `else if` chain and making them all just `if`s. I also added a newline between each `if`s, which I feel is easier to read.
1 parent 08bba65 commit 11d3c76

File tree

3 files changed

+214
-158
lines changed

3 files changed

+214
-158
lines changed

0 commit comments

Comments
 (0)