[release/8.0-staging] Extend mono_gsharedvt_constrained_call for static virtual calls #101491
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.
Description
Backport of #94787 to release/8.0-staging
Before this change, when an icall was made from the gsharedvt with a constrained static virtual method, the
thisargument wasn't handled properly, leading to aSIGSEGVerror. Additionally, nullable boxed value types were not dereferenced correctly. This PR expands the functionality ofmono_gsharedvt_constrained_callto manage static call arguments and avoid dereferencing sharedvt reference arguments if they are nullable value types.Customer Impact
The issue was reported on Apple mobile platforms in #94467 and #101427. It should fix #101427 and resolve tests failures on Apple mobile platforms.
This issue also fixes a regression introduced in .NET 8.0.2 that prevents Blazor WebAssembly applications that use MudBlazor from being AOTed. Fixes #100527
Testing
This PR introduces a runtime test, similar to the one implemented for .NET 9 (#101489). This fix is verified manually and by the existing
System.Collections.Immutable.Testson Apple mobile platforms.Risk
Low risk. This change extends functionality of the
mono_gsharedvt_constrained_callicalls to handle static virtual methods.This backport is for a servicing release 8.0.3.
The PR target branch is
release/X.0-staging, notrelease/X.0.If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.