Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamllex and ocamlyacc should check that there are balanced parentheses in code blocks #7455

Closed
vicuna opened this issue Jan 8, 2017 · 8 comments · Fixed by #11716
Closed

Comments

@vicuna
Copy link

vicuna commented Jan 8, 2017

Original bug ID: 7455
Reporter: dobenour
Status: acknowledged (set by @xavierleroy on 2017-02-19T16:59:08Z)
Resolution: open
Priority: normal
Severity: minor
Version: 4.04.0
Target version: 4.07.0+dev/beta2/rc1/rc2
Category: tools (ocaml{lex,yacc,dep,debug,...})
Monitored by: bikal

Bug description

ocamllex and ocamlyacc both fail to check for balanced parentheses in code blocks. This allows for invalid OCaml code to be generated. In the case of ocamlyacc, it might be possible to break the type system due to the use of Obj in the generated code, though I don't think so.

File attachments

@vicuna
Copy link
Author

vicuna commented Jan 8, 2017

Comment author: @dra27

Out of curiosity, do you have a nefarious example which actually compiles?

@vicuna
Copy link
Author

vicuna commented Jan 9, 2017

Comment author: dobenour

I just attached conflict.mly. When processed with ocamlyacc, it produces a file conflict.ml which segfaults when run.

@vicuna
Copy link
Author

vicuna commented Jan 15, 2017

Comment author: @dra27

#1012

@vicuna
Copy link
Author

vicuna commented Aug 6, 2017

Comment author: @Octachron

Note: the above PR has been merged in 4.06 trunk and fixes the issue on the ocamlyacc side, but not the ocamllex side.

@vicuna vicuna added the tools label Mar 14, 2019
@vicuna vicuna added this to the 4.07.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
@github-actions
Copy link

github-actions bot commented May 9, 2020

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 9, 2020
@dra27 dra27 removed the Stale label May 9, 2020
@damiendoligez damiendoligez removed this from the 4.07.0 milestone Oct 6, 2020
@github-actions
Copy link

github-actions bot commented Oct 8, 2021

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Oct 8, 2021
@gasche
Copy link
Member

gasche commented Oct 8, 2021

It looks like no one is willing to put the work to solve this issue (for ocamllex; the ocamlyacc part has been solved). Maybe it's okay to officially give up and close it for good?

@github-actions github-actions bot removed the Stale label Oct 11, 2021
@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Oct 12, 2022
DemiMarie added a commit to DemiMarie/ocaml that referenced this issue Nov 11, 2022
This checks that parentheses and curly braces are properly balenced in
ocamllex actions.

Fixes ocaml#7455 for ocamllex (it was already fixed for ocamlyacc).
DemiMarie added a commit to DemiMarie/ocaml that referenced this issue Nov 12, 2022
This checks that parentheses and curly braces are properly balenced in
ocamllex actions.

Fixes ocaml#7455 for ocamllex (it was already fixed for ocamlyacc).
DemiMarie added a commit to DemiMarie/ocaml that referenced this issue Nov 12, 2022
This checks that parentheses and curly braces are properly balenced in
ocamllex actions.

Fixes ocaml#7455 for ocamllex (it was already fixed for ocamlyacc).
DemiMarie added a commit to DemiMarie/ocaml that referenced this issue Nov 15, 2022
This checks that parentheses and curly braces are properly balenced in
ocamllex actions.  It also significantly refactors ocamllex’s lexer to
pass state using function arguments instead of mutable global variables.

Fixes ocaml#7455 for ocamllex (it was already fixed for ocamlyacc).
DemiMarie added a commit to DemiMarie/ocaml that referenced this issue May 23, 2023
This checks that parentheses and curly braces are properly balenced in
ocamllex actions.  It also significantly refactors ocamllex’s lexer to
pass state using function arguments instead of mutable global variables.

Fixes ocaml#7455 for ocamllex (it was already fixed for ocamlyacc).
DemiMarie added a commit to DemiMarie/ocaml that referenced this issue Feb 6, 2024
This checks that parentheses and curly braces are properly balenced in
ocamllex actions.  It also significantly refactors ocamllex’s lexer to
pass state using function arguments instead of mutable global variables.

Fixes ocaml#7455 for ocamllex (it was already fixed for ocamlyacc).
damiendoligez pushed a commit that referenced this issue Feb 7, 2024
This checks that parentheses and curly braces are properly balanced in
ocamllex actions.  It also significantly refactors ocamllex’s lexer to
pass state using function arguments instead of mutable global variables.

Fixes #7455 for ocamllex (it was already fixed for ocamlyacc).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants