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

Fix: Compiled lambdas now close only on non-ghost variables #2854

Merged
merged 6 commits into from
Oct 6, 2022

Conversation

MikaelMayer
Copy link
Member

@MikaelMayer MikaelMayer commented Oct 5, 2022

This PR fixes the problem that lambdas were closing over ghost variables in compiled code, resulting at best in compilation errors (in C#), at worst in a soundness issue crash at run-time (in js). As you can see, the fix is very small. I added an integration test to ensure this behavior is correctly captured.

Fixes #2852
Fixes #2690

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

This PR fixes the problem that lambdas were closing over ghost variables in compiled code, resulting at best in compilation errors (in C#), at worst in a soundness issue crash at run-time (in js).
As you can see, the fix is very small. I added an integration test to ensure this behavior is correctly captured.
keyboardDrummer
keyboardDrummer previously approved these changes Oct 5, 2022
cpitclaudel
cpitclaudel previously approved these changes Oct 6, 2022
Copy link
Member

@cpitclaudel cpitclaudel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Could you check if this PR also fixes bug #2690 ? If so, it would be good to copy the test from there (and if not, it would be good to add a note to that issue)

@MikaelMayer
Copy link
Member Author

Looks good to me. Could you check if this PR also fixes bug #2690 ? If so, it would be good to copy the test from there (and if not, it would be good to add a note to that issue)

As a matter of fact, it does fix #2690. Let me add them as tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants