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 #12806, finally block gets skipped by 'break' inside try #24075

Merged
merged 1 commit into from
Oct 11, 2017

Conversation

JeffBezanson
Copy link
Sponsor Member

This is easiest to handle during linearization. The approach is to keep some state describing the currently active try-finally block, and have return and break update that state to tell the finally block what to do after executing. This could also be extended pretty easily to handle arbitrary gotos.

Some test cases shamelessly stolen from #13660.

It's not totally clear whether this should be backported, since it could subtly change the behavior of a program.

@JeffBezanson JeffBezanson added bugfix This change fixes an existing bug compiler:lowering Syntax lowering (compiler front end, 2nd stage) labels Oct 10, 2017
@StefanKarpinski
Copy link
Sponsor Member

It's not totally clear whether this should be backported, since it could subtly change the behavior of a program.

When in doubt, let's not. No point in doing more work just to risk breaking people's code.

@JeffBezanson JeffBezanson merged commit 0c1edbf into master Oct 11, 2017
@JeffBezanson JeffBezanson deleted the jb/fix12806 branch October 11, 2017 18:42
JeffBezanson added a commit that referenced this pull request Oct 25, 2017
JeffBezanson added a commit that referenced this pull request Oct 26, 2017
tkluck added a commit to tkluck/julia that referenced this pull request Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug compiler:lowering Syntax lowering (compiler front end, 2nd stage)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants