[release/9.0-staging] Fix UnsafeAccessor scenario for modopts/modreqs when comparing field sigs.#111675
Merged
AaronRobinsonMSFT merged 1 commit intodotnet:release/9.0-stagingfrom Jan 24, 2025
Conversation
…d sigs. (dotnet#111648) * Consume custom modifiers and ByRef in RetType signature prior to comparing field signature.
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-runtime-compilerservices |
Contributor
There was a problem hiding this comment.
Copilot reviewed 1 out of 4 changed files in this pull request and generated no comments.
Files not reviewed (3)
- src/coreclr/vm/prestub.cpp: Language not supported
- src/coreclr/vm/siginfo.cpp: Language not supported
- src/coreclr/vm/siginfo.hpp: Language not supported
jeffschwMSFT
approved these changes
Jan 21, 2025
Member
jeffschwMSFT
left a comment
There was a problem hiding this comment.
lgtm. please get a code review. we will take for consideration in 9.0.x
jkotas
approved these changes
Jan 21, 2025
eaea271
into
dotnet:release/9.0-staging
98 of 104 checks passed
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #111648 to release/9.0-staging
Customer Impact
Consume custom modifiers and ByRef in RetType signature prior to comparing field signature. Specifically signatures have contain modopts/modreqs. This is follow-up for #109694, which was also a .NET 9 servicing for a regression, but missed a specific scenario involving
readonlyand was testing using aUnsafeAccessordeclaration that did not properly validate the scenario.Fixes #111647
Regression
Issue #109665 was fixed with #109694 and assumed to also address issues with
readonlyand so tests were added with in #109944 - these tests do pass.The issue is best showcased with the following:
The
MEMBERandLOCALare the same definition, butMEMBERuses anmodreqwhenLOCALdoesn't. For testing, theLOCALscenario was used for validation and this created a false sense of correctness in the tests. The result is the modopt/modreq issues can still occur for fields depending on how theUnsafeAccessoris defined. This means we need to service .NET 9 again, see #109709, and make the correct fix in .NET 10 along with updating the testing so we validate both types of definition.Testing
New tests have been added and the existing tests have been updated to cover this scenario.
Risk
Medium. This is likely "Low" from a regression standpoint, but increases the Risk since this is a second attempt at a fix. There is much more confidence in this fix after uncovering the metadata differences in signature declaration.