Skip to content

Fixes a null ref which happens when an XML comment cref contains generic instantiation#3015

Merged
vitek-karas merged 2 commits intodotnet:mainfrom
vitek-karas:FixNullRefInCRefAnalyzer
Sep 1, 2022
Merged

Fixes a null ref which happens when an XML comment cref contains generic instantiation#3015
vitek-karas merged 2 commits intodotnet:mainfrom
vitek-karas:FixNullRefInCRefAnalyzer

Conversation

@vitek-karas
Copy link
Member

In the cref some of the symbols (for example the type argument) are missing containing symbols, which leads to null refs.

In any case, we should not perform any analysis on symbols inside crefs, only on real code.

So this modifies the analyzer to ignore any symbol inside a cref.

Adds a test to validate this.

Fixes #3014

…ric instantiation

In the cref some of the symbols (for example the type argument) are missing containing symbols, which leads to null refs.

In any case, we should not perform any analysis on symbols inside crefs, only on real code.

So this modifies the analyzer to ignore any symbol inside a cref.

Adds a test to validate this.
Copy link
Member

@sbomer sbomer left a comment

Choose a reason for hiding this comment

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

Thank you!

@vitek-karas vitek-karas merged commit 1352b54 into dotnet:main Sep 1, 2022
@vitek-karas vitek-karas deleted the FixNullRefInCRefAnalyzer branch September 1, 2022 20:52
vitek-karas added a commit to vitek-karas/linker that referenced this pull request Sep 1, 2022
…ric instantiation (dotnet#3015)

* Fixes a null ref which happens when an XML comment cref contains generic instantiation

In the cref some of the symbols (for example the type argument) are missing containing symbols, which leads to null refs.

In any case, we should not perform any analysis on symbols inside crefs, only on real code.

So this modifies the analyzer to ignore any symbol inside a cref.

Adds a test to validate this.

* Simplify the test
vitek-karas added a commit that referenced this pull request Sep 2, 2022
… contains generic instantiation (#3020)

* Fixes a null ref which happens when an XML comment cref contains generic instantiation (#3015)

* Fixes a null ref which happens when an XML comment cref contains generic instantiation

In the cref some of the symbols (for example the type argument) are missing containing symbols, which leads to null refs.

In any case, we should not perform any analysis on symbols inside crefs, only on real code.

So this modifies the analyzer to ignore any symbol inside a cref.

Adds a test to validate this.

* Simplify the test

* Fix the test to work on slightly older analyzer
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
…ric instantiation (dotnet/linker#3015)

* Fixes a null ref which happens when an XML comment cref contains generic instantiation

In the cref some of the symbols (for example the type argument) are missing containing symbols, which leads to null refs.

In any case, we should not perform any analysis on symbols inside crefs, only on real code.

So this modifies the analyzer to ignore any symbol inside a cref.

Adds a test to validate this.

* Simplify the test

Commit migrated from dotnet/linker@1352b54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NullRef in analyzer when generic instantiation used in cref

2 participants