-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix lift try and captured vars interaction #758
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 lift try and captured vars interaction #758
Conversation
Note: This PR uncovered (and fixes) a deeper problem about miniphase assembly which caused a |
2a5c446
to
5483088
Compare
It can happen that changeOwner sees symbols that are not defined yet at the phase where the method is run. Such symbols should be ignored.
There were two architectural errors here, which confused TreeTransforms and MiniPhases and which caused "NotDefinedHere" on transformFollowing: 1. TreeTransforms should not have idx fields, MiniPhases have them.2 2. TreeTransformers initialize arrays of MiniPhases not TreeTransforms.
CapturedVars introduced an assignment that could cause a try to be executed with a non-empty stack, even after LiftTry had already run. We now avoid this by introducing a temporary variable.
Checks the hypothesis that lifting a try may safely move expressions into a ValDef owned by a new temp var.
3c69bff
to
4ff0636
Compare
@DarkDimius Can you take a look at what fails here? The PR tests OK locally, but it seems we run out of memory on jenkins. Edit: test commit passes, so it must be in the commits of this PR. Will investigate. |
/rebuild |
It was a spurious failure, after all. |
Otherwise LGTM |
installAfter now overwrites denotaton also when the first denotation of a symbol is defined after the current phase. Previously, a new denotation with a last valid phase before a first valid phase was created.
@DarkDimius Last two commits ready for review. |
LGTM |
…-interaction Fix lift try and captured vars interaction
Replaces #753. Review by @DarkDimius.