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

Harden InterproceduralAnalysisConfiguration to prevent null tree argu… #4492

Merged
merged 1 commit into from
Dec 3, 2020

Conversation

mavasani
Copy link
Member

@mavasani mavasani commented Dec 3, 2020

…ment

Change the API argument for InterproceduralAnalysisConfiguration.Create to avoid null syntax tree being passed into it.

Fixes #4491. I will create a separate PR to port the fix to 2.9.x branch

…ment

Change the API argument for `InterproceduralAnalysisConfiguration.Create` to avoid null syntax tree being passed into it.

Fixes dotnet#4491. I will create a separate PR to port the fix to 2.9.x branch
@mavasani mavasani requested a review from dotpaul December 3, 2020 16:36
@mavasani mavasani requested a review from a team as a code owner December 3, 2020 16:36
@@ -40,16 +40,16 @@ public struct InterproceduralAnalysisConfiguration : IEquatable<InterproceduralA
public static InterproceduralAnalysisConfiguration Create(
AnalyzerOptions analyzerOptions,
DiagnosticDescriptor rule,
ISymbol symbol,
ControlFlowGraph cfg,
Copy link
Member Author

@mavasani mavasani Dec 3, 2020

Choose a reason for hiding this comment

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

This is the core change, everything else in the PR is just boiler plate changes. For VB assembly attributes, owning symbol of operation block callback is the global namespace symbol, whose first location is some embedded source with null syntax tree.

@mavasani
Copy link
Member Author

mavasani commented Dec 3, 2020

I will create a separate PR to port the fix to 2.9.x branch

@dotpaul - I figured out that this issue does not repro on 2.9.x branch as the support for passing in symbol or tree into the constructor of InterproceduralAnalysisConfiguration was added during 3.3.x when editorconfig options support was added. Constructor on 2.9.x:

public static InterproceduralAnalysisConfiguration Create(
AnalyzerOptions analyzerOptions,
DiagnosticDescriptor rule,
InterproceduralAnalysisKind defaultInterproceduralAnalysisKind,
CancellationToken cancellationToken,
uint defaultMaxInterproceduralMethodCallChain = DefaultMaxInterproceduralMethodCallChain,
uint defaultMaxInterproceduralLambdaOrLocalFunctionCallChain = DefaultMaxInterproceduralLambdaOrLocalFunctionCallChain)
{

@codecov
Copy link

codecov bot commented Dec 3, 2020

Codecov Report

Merging #4492 (23619eb) into release/5.0.2xx (f7aad5c) will decrease coverage by 0.00%.
The diff coverage is 61.40%.

@@                 Coverage Diff                 @@
##           release/5.0.2xx    #4492      +/-   ##
===================================================
- Coverage            95.79%   95.79%   -0.01%     
===================================================
  Files                 1164     1164              
  Lines               264445   264459      +14     
  Branches             15976    15979       +3     
===================================================
+ Hits                253322   253330       +8     
- Misses                9098     9101       +3     
- Partials              2025     2028       +3     

Copy link
Contributor

@dotpaul dotpaul left a comment

Choose a reason for hiding this comment

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

🚢

@mavasani
Copy link
Member Author

mavasani commented Dec 3, 2020

Thanks you Paul!

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

2 participants