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

Code in the distribution relies on the ordering of let bindings #6803

Closed
vicuna opened this issue Mar 4, 2015 · 2 comments
Closed

Code in the distribution relies on the ordering of let bindings #6803

vicuna opened this issue Mar 4, 2015 · 2 comments
Assignees
Labels
Milestone

Comments

@vicuna
Copy link

vicuna commented Mar 4, 2015

Original bug ID: 6803
Reporter: @lpw25
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2017-02-16T14:16:18Z)
Resolution: fixed
Priority: normal
Severity: tweak
Target version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @yallop @hcarty

Bug description

The manual says that the ordering of let-and bindings is unspecified. However, there is code in the distribution that relies on the order being top-to-bottom.

I'm not sure that this really constitutes a bug, but it would seem wise to avoid unspecified behavior where possible.

I came across this whilst working on a patch to the parser. I accidentally reversed the order of all let bindings, and whilst the compiler would still compile it would raise an unhandled exception whenever it was run.

I believe the specific problem causing the crash was the use of let-and bindings in CamlinternalOO.method_impl and CamlinternalOO.set_methods.

@vicuna
Copy link
Author

vicuna commented Mar 5, 2015

Comment author: @gasche

I would merge patches that linearize dangerous "let .. and ...".

@vicuna
Copy link
Author

vicuna commented Dec 2, 2015

Comment author: @alainfrisch

Well spotted, thanks. Fixed in trunk d736c2c.

@vicuna vicuna closed this as completed Feb 16, 2017
@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants