Fix Crash from Missing MRGCTX on Default Interface Method #2152
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.
Mono assumes that all generic default interface methods should pass there generic context in the method generic context register. However it does not correct mark this at the call site when the method isn't sharable.
This leads to a crash in the trampoline where it looks for the generic context on any default interface method.
This crash does not occur in upstream - it was fixed by dotnet/runtime#64129 which replaced the code that this PR patches. It looks like the cleanup in that PR fixed this issues, even if it wasn't explicitly called out.
Reviewers: please consider these questions as well! ❤️
Release notes
Fixed UUM-109706 @scott-ferguson-unity
Mono: Fix Crash when invoking a default interface method that is generic with value type generic argument
Backports
This does affect all supported versions - but we will want to make sure we understand the risk of this change before backporting.
List the versions of Unity where this change should be back ported here.
-->