Skip to content

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

Merged
vladima merged 1 commit intomasterfrom
vladima/12205
Feb 13, 2017
Merged

inject pre-finally and after-finally edges into flow graph to possibly ignore pre-finally during flow walk#13845
vladima merged 1 commit intomasterfrom
vladima/12205

Conversation

@vladima
Copy link
Copy Markdown
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