Skip to content

Erroneous code transformation at partial applications (MPR#7531)#1162

Merged
mshinwell merged 2 commits intoocaml:trunkfrom
mshinwell:pr7531
Jun 14, 2017
Merged

Erroneous code transformation at partial applications (MPR#7531)#1162
mshinwell merged 2 commits intoocaml:trunkfrom
mshinwell:pr7531

Conversation

@mshinwell
Copy link
Contributor

@mshinwell mshinwell commented May 8, 2017

Effects may be incorrectly pushed under lambdas that are generated at partial application sites when using the Closure path of the native code compiler. The test case here is a slightly more elaborate version of MPR#7531; it checks for non-duplication of an effect as well as ensuring that the function component of an application gets evaluated after the argument.

This should probably go on 4.05 as well.

@mshinwell
Copy link
Contributor Author

Addendum: the output of the test case without this patch is:

x
01foo
first
first
bar

@mshinwell mshinwell added the bug label May 8, 2017
@lpw25
Copy link
Contributor

lpw25 commented May 15, 2017

This looks correct to me

@stedolan
Copy link
Contributor

Looks good! (For a few minutes I'd convinced myself that the subsequent code for handling over-applications had the same issue, but I think I was mistaken and it's correct)

@mshinwell
Copy link
Contributor Author

I also had such a misapprehension, but after looking through the code with @lpw25 I also think the overapplication code is now correct (I fixed that a while back, IIRC).

@stedolan
Copy link
Contributor

Yes, it looks like the issue I was worrying about was fixed by #967.

@mshinwell
Copy link
Contributor Author

This patch actually had a slightly obscure bug, which has been fixed by the commit I just pushed (fda3820).

@mshinwell
Copy link
Contributor Author

@xavierleroy Does this look correct to you?

@damiendoligez
Copy link
Member

@mshinwell how important is it to have it in 4.05 ?

@mshinwell
Copy link
Contributor Author

This seems important to me.

FWIW, we're running with this patch (on 4.04) at Jane Street now, and I don't believe there have been any problems.

@damiendoligez damiendoligez added this to the 4.05.0 milestone Jun 14, 2017
@damiendoligez
Copy link
Member

I've reviewed and it seems low-risk enough, let's merge and cherry-pick to 4.05.

@mshinwell
Copy link
Contributor Author

Merged and cherry-picked to 4.05.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants