[release/6.0] [mini] Don't add unbox tramopline on generic DIM calls #58585
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 #58521 to release/6.0
/cc @lambdageek
Customer Impact
Code using generic default interface methods instantiated to valuetypes will crash. The cause is an incorrect unboxing of the
this
argument of the managed method. The callee would work correctly but when someone usedthis
, there would be incorrect data or a crash.Fixes #58394
Testing
CI. Added a new regression test.
Risk
Moderate. I added some additional assertions in the trampoline for calls like this on branches that I thought couldn't happen. It's possible there's some managed code that could hit those assertions. (On the other hand if I preemptively fixed the "couldn't happen" cases incorrectly, or if they're incorrect to begin with, those crashes would be difficult to diagnose since they would be in later unrelated managed methods).