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

Incorrect code generation for nested recursive bindings #7447

Closed
vicuna opened this issue Jan 2, 2017 · 2 comments
Closed

Incorrect code generation for nested recursive bindings #7447

vicuna opened this issue Jan 2, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@vicuna
Copy link

@vicuna vicuna commented Jan 2, 2017

Original bug ID: 7447
Reporter: @yallop
Assigned to: @chambart
Status: resolved (set by @mshinwell on 2017-03-10T16:48:39Z)
Resolution: fixed
Priority: normal
Severity: minor
Target version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Fixed in version: 4.06.0 +dev/beta1/beta2/rc1
Category: back end (clambda to assembly)
Tags: patch
Related to: #7231
Monitored by: @stedolan

Bug description

This issue was originally reported by stedolan under 7231 (where there's some discussion), but it deserves its own PR, since it's a different problem. Here's stedolan's report:

This seems like a thorny issue. How does the patch handle the following?

    # let rec r = (let rec x = `A r and y = fun () -> x in y);;
    val r : unit -> [> `A of 'a ] as 'a = <fun>
    # let (`A x) = r () in x ();;
    Segmentation fault

Note that in this example, the right-hand sides of each equation are more sensible, since no value is eliminated during its definition (the suspicious 'y ()' from the original test case has been removed).

(The polymorphic variant `A is used to allow recursive types, you can also try this example using plain variants and -rectypes.) 

(ocaml/ocaml#7231#c15819)
@vicuna
Copy link
Author

@vicuna vicuna commented Jan 2, 2017

Comment author: @yallop

There's a patch here: #995

@vicuna
Copy link
Author

@vicuna vicuna commented Mar 10, 2017

Comment author: @mshinwell

#995 has been merged to trunk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.