Skip to content

inject pre-finally and after-finally edges into flow graph to possibly ignore pre-finally during flow walk #13845

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

Merged
merged 1 commit into from
Feb 13, 2017

Conversation

vladima
Copy link
Contributor

@vladima vladima commented Feb 2, 2017

fix proposal for #12205

I've tried the approach with copying the flow graph in finally block and decided not to use it since in presence of nested try-finally blocks in becomes quite complicated. As an alternative I'd like to propose different approach: for try-finally blocks we inject two extra edges in the flow graph. One edge will link pre-try flow with pre-finally label, another will act as a proxy for post-finally flow. If during the flow walk we touch the post-finally flow edge we can mark matching pre-finally edge as blocked so it will be ignored. The overhead of this approach is also much smaller than copying - max two objects per protected region which sounds like a reasonable thing.

// cc @ahejlsberg, @mhegazy

@vladima vladima merged commit f673f48 into master Feb 13, 2017
@vladima vladima deleted the vladima/12205 branch February 13, 2017 22:36
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants