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 null cfg bug. #3050

Merged
merged 2 commits into from Nov 23, 2019
Merged

Conversation

LLLXXXCCC
Copy link
Contributor

No description provided.

@LLLXXXCCC LLLXXXCCC requested a review from a team as a code owner November 18, 2019 07:37
@@ -77,6 +77,11 @@ public override void Initialize(AnalysisContext context)
}

ControlFlowGraph cfg = operationBlockStartContext.OperationBlocks.GetControlFlowGraph();
if (cfg == null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a unit test for this?

Copy link
Contributor

@dotpaul dotpaul Nov 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like Test_NullCfg_NoDiagnostic covers this.

Any performance concerns with GetControlFlowGraph() off the top of your head?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh are we creating a CFG for every operation block? We should certainly avoid that. CFG should only be computed for methods where we know will be perfoming DFA.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dotpaul Can we create a work item/PR to ensure we create CFG lazily at the point where we know we will be executing DFA?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping @LLLXXXCCC could fix this instance in this PR. I think this is the only place where the CFG is can be created without attempting DFA.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix a new PR.

@dotpaul dotpaul merged commit 070f56b into dotnet:2.9.x Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants