Skip to content

Conversation

@mlasson
Copy link
Contributor

@mlasson mlasson commented Sep 19, 2022

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

@mlasson mlasson changed the title Break the switch, not the for Bugfix in ocamlyacc runtime code Sep 19, 2022
@hhugo
Copy link
Member

hhugo commented Sep 19, 2022

Can we include the repro case as well ?

@mlasson
Copy link
Contributor Author

mlasson commented Sep 19, 2022

Where do you want to include it ?
In a PR description ? In a test ? In a comment ?
But, sure, yes, feel free.

@mlasson
Copy link
Contributor Author

mlasson commented Sep 19, 2022

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 ?

@hhugo
Copy link
Member

hhugo commented Sep 19, 2022

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-ocamlyacc in the compiler directory ?

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 #1308 follows the native version.

@hhugo
Copy link
Member

hhugo commented Oct 4, 2022

@mlasson, Gentle ping

@hhugo hhugo merged commit cd52f81 into ocsigen:master Oct 14, 2022
@hhugo
Copy link
Member

hhugo commented Oct 14, 2022

Adding test in #1315

@mlasson mlasson deleted the mlasson-fix-parsing branch October 14, 2022 16:28
@mlasson
Copy link
Contributor Author

mlasson commented Oct 14, 2022

Thanks

hhugo pushed a commit to hhugo/opam-repository that referenced this pull request Nov 15, 2022
…s_of_ocaml-ppx_deriving_json, js_of_ocaml-ppx, js_of_ocaml-lwt and js_of_ocaml-compiler (4.1.0)

CHANGES:

## Features/Changes
* Compiler: initial support for OCaml 5 (ocsigen/js_of_ocaml#1265,ocsigen/js_of_ocaml#1303)
* Compiler: bump magic number to match the 5.0.0~alpha0 release (ocsigen/js_of_ocaml#1288)
* Compiler: complain when runtime and compiler built-in primitives disagree (ocsigen/js_of_ocaml#1312)
* Compiler: more efficient implementation of Js_traverse.freevar
* Compiler: more efficient implementation of Js_traverse.rename_variable
* Compiler: --linkall now export all compilation units in addition to primitives (ocsigen/js_of_ocaml#1324)
* Compiler: improve --dynlink, one no longer need to pass --toplevel to use Dynlink (ocsigen/js_of_ocaml#1324)
* Compiler: toplevel runtime files "+toplevel.js" and "+dynlink.js" are added automatically (ocsigen/js_of_ocaml#1324)
* Misc: switch to cmdliner.1.1.0
* Misc: remove old binaries jsoo_link, jsoo_fs
* Misc: remove uchar dep
* Misc: use 4.14 in the CI
* Misc: switch to dune 3
* Lib: add missing options for Intl.DateTimeFormat
* Lib: add missing options for Intl.NumberFormat
* Lib: wheel event binding
* Lib: add normalize in js_string (ES6)
* Lib: more complete transition event bindings
* Lib: remove support for old browser-specific transition events
* Runtime: Implement weak semantic for weak and ephemeron
* Runtime: Implement Gc.finalise_last
* Runtime: Implement buffer for in_channels
* Runtime: add support for unix_opendir, unix_readdir, unix_closedir, win_findfirst, win_findnext, win_findclose
* Runtime: Dont use require when target-env is browser
* Runtime: Implements Parsing.set_trace (ocsigen/js_of_ocaml#1308)
* Test: track external used in the stdlib and unix

## Bug fixes
* Compiler: fix quadratic behavior of dominance frontier (fix ocsigen/js_of_ocaml#1300)
* Compiler: fix rewriter bug in share_constant (fix ocsigen/js_of_ocaml#1247)
* Compiler: fix miscompilation of mutually recursive functions in loop (ocsigen/js_of_ocaml#1321)
* Compiler: fix bug while minifying/renaming try-catch blocks
* Compiler: no dead code elimination for caml_js_get
* Runtime: fix ocamlyacc parse engine (ocsigen/js_of_ocaml#1307)
* Runtime: fix Out_channel.is_buffered, set_buffered
* Runtime: fix format wrt alternative
* Runtime: fix Digest.channel
* Runtime: sync channel seek / pos with the native runtime
* Misc: fix installation with dune 3 without opam
* Node: Only write small chunks to stdout/stderr so they flush
* Deriving: fix for nested polymorphic variants
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants