Support assignment to multiple refs in trim analyzer#90287
Support assignment to multiple refs in trim analyzer#90287sbomer merged 4 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to 'linkable-framework': @eerhardt, @vitek-karas, @LakshanF, @sbomer, @joperezr, @marek-safar Issue DetailsFixes dotnet/linker#3046 by adding analyzer support for assignments to multiple refs, for example: (b ? ref f1 : ref f2) = v;This also includes support for assignments by reference to array elements: (b ? ref a1[0] : ref a2[0]) = v;ILLink and ILCompiler produce a different warning in this case ( Also fixes assignment to multiple arrays on the LHS (this appears to be an analysis hole in ILLink and ILCompiler): (b ? a1 : a2)[0] = v;
|
agocke
left a comment
There was a problem hiding this comment.
LGTM aside from test suggestion
|
/backport to release/8.0 |
|
Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/5941987950 |
Fixes dotnet/linker#3046 by adding analyzer support for assignments to multiple refs, for example:
This also includes support for assignments by reference to array elements:
ILLink and ILCompiler produce a different warning in this case (
stdin.refresults in the array values being replaced withUnknownValue). 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):