js_of_ocaml
js_of_ocaml copied to clipboard
Bugfix in ocamlyacc runtime code
Description
The parsing module runtime has a bug in parsing.js.
In happened in the "ERROR_DETECTED" case. There's a break instruction that is breaking a for loop instead of breaking a switch. Which makes the "flow" fall through the "SHIFT" case instead of the "SHIFT_RECOVER" case.
This PR adds a label to fix this.
Here is a reproduction case, https://github.com/mlasson/js-yacc-bug
Can we include the repro case as well ?
Where do you want to include it ? In a PR description ? In a test ? In a comment ? But, sure, yes, feel free.
Where do you want to include it ? In a PR description ? In a test ? In a comment ? But, sure, yes, feel free.
I can add a test myself if you want. In that case, should I add a directory tests-ocamlyacc in the compiler directory ?
I
Where do you want to include it ? In a PR description ? In a test ? In a comment ? But, sure, yes, feel free.
I can add a test myself if you want. In that case, should I add a directory
tests-ocamlyaccin thecompilerdirectory ?
Adding it in compiler/tests-jsoo would make it run in both native and js. I would also be a good place to make sure https://github.com/ocsigen/js_of_ocaml/pull/1308 follows the native version.
@mlasson, Gentle ping
Adding test in https://github.com/ocsigen/js_of_ocaml/pull/1315
Thanks