[release/9.0] Fix HashSet copy constructor handling of instances that have fallen back to the randomized hashcode generator. (#107613)#107685
Merged
carlossanlop merged 1 commit intodotnet:release/9.0from Sep 16, 2024
Conversation
…ack to the randomized hashcode generator. (dotnet#107613)
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-collections |
GrabYourPitchforks
approved these changes
Sep 12, 2024
Contributor
|
@artl93 did you get a chance to look at this one? It's ask-mode so needs M2 approval. |
artl93
approved these changes
Sep 16, 2024
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 #107613 to release/9.0
/cc @eiriktsarpalis
Customer Impact
Fixes a customer reported issue where passing a
HashSet<string>that has fallen back to randomized string comparison will result in a corrupted set being created.Regression
Likely introduced in .NET 5 via #37180 which brought in non-randomized string comparison.
Testing
Added unit testing validating that the copy constructor works as expected.
Risk
Moderate. While this is a targeted fix,
HashSet<T>is a very common core type so any change carries an elevated degree of risk.