WebAssembly / spec

WebAssembly specification, reference interpreter, and test suite.
https://webassembly.github.io/spec/
Other
3.13k stars 445 forks source link

[interpreter] Source locations are broken since menhir switch #1723

Closed rossberg closed 7 months ago

rossberg commented 7 months ago

I only noticed now that the switch to menhir in #1705 completely broke the implementation of source locations for the AST – they are all empty, producing useless messages for type or runtime errors.

The current implementation depends on reading out Parsing.symbol_start/end_pos, which are defunct with menhir.

Unfortunately, menhir offers no easy substitute – afaict we'll need to change every single rule to use $sloc and $loc($i). Or revert #1705.

@zapashcanon, can you please look into this?

rossberg commented 7 months ago

Never mind, I fixed it: https://github.com/WebAssembly/spec/commit/5b26fa20d4f63c1bdb33f6d19ef147aad501230d

zapashcanon commented 7 months ago

Oh, sorry about that. Thanks for the quick fix.