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 escaping pattern aliases #5288

Closed
vicuna opened this issue Jun 10, 2011 · 3 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Jun 10, 2011

Original bug ID: 5288
Reporter: @lefessan
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2012-09-25T18:06:17Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: all
OS: all
OS Version: all
Version: 3.12.0
Target version: 3.12.0
Fixed in version: 3.13.0+dev
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #5205
Monitored by: @ygrek

Bug description

Pattern-matching generate aliases of variables during its
compilation. Such aliases are evaluated lazily when they are used only
once. This optimization is performed even if they are used in an
abstraction, in which case they might make a bigger datastructure
escape from its scope, and lead to an important memory leak.

The following patch fixes this behavior by preventing the substitution when
aliases are used in abstractions and in loops.

File attachments

@vicuna

This comment has been minimized.

Copy link
Author

commented Jun 10, 2011

Comment author: @alainfrisch

I think this is a duplicate of #5205. Now we have two patches :-)

@vicuna

This comment has been minimized.

Copy link
Author

commented Jun 10, 2011

Comment author: @lefessan

You are right, I didn't understand it was the same issue, but looking at the patches, we are fixing the same problem with two different patches ;-)

@vicuna

This comment has been minimized.

Copy link
Author

commented Jun 11, 2011

Comment author: @xavierleroy

Implemented in SVN trunk, along the lines of Fabrice's patch but (for the time being) without the inlining of locally-let-bound functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.