-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support assignment to multiple refs in trim analyzer (#90287)
Fixes dotnet/linker#3046 by adding analyzer support for assignments to multiple refs, for example: ```csharp (b ? ref f1 : ref f2) = v; ``` This also includes support for assignments by reference to array elements: ```csharp (b ? ref a1[0] : ref a2[0]) = v; ``` ILLink and ILCompiler produce a different warning in this case (`stdin.ref` results in the array values being replaced with `UnknownValue`). I attempted to quirk this in the analyzer, but this caused more problems in existing tests because it was difficult to make the quirk specific enough. Also fixes assignment to multiple arrays on the LHS (this appears to be an analysis hole in ILLink and ILCompiler): ```csharp (b ? a1 : a2)[0] = v; ```
- Loading branch information
Showing
9 changed files
with
293 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.