-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Support assignment to multiple refs in trim analyzer #90287
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;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.ref
results 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):