Fix Crash Due to Incorrect Optimization of EqualityComparer<T>.Default on Generic Record Type #2127
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.
This is a backport of mono@ef848cf, which is it self a backport of dotnet/runtime#59861
This addresses fixes dotnet/runtime#72181.
The root issue is that the devitalization of
EqualityComparer<T>.Default
may generate an instance with open generic types still it in. This causes a virtual method resolution lookup in method-to-ir.c to fail and trigger an assert. The upstream fix will disable the devitalization and do a normal virtual call in this case.Reviewers: please consider these questions as well! ❤️
Release notes
Fixed UUM-99151 @scott-ferguson-unity
Mono: Fixed crash on incorrectly optimized calls to EqualityComparer.Default in Generic Record Type Equals implementations