Repository navigation
Conversation
Re-applying the base method's class instantiation to an inflated vtable method doubled shared type arguments in devirtualized calls.
vrimar
requested review from
steveisok,
thaystg and
vitek-karas
as code owners
November 7, 2026 02:25
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Author
|
@dotnet-policy-service agree |
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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_class_get_virtual_methodre-inflates the vtable slot method with the requested method's full context. If the slot method is already inflated, re-applyingclass_instsubstitutes into its remaining shared type variables.In shared code this breaks devirtualized
EqualityComparer<F>.Default.EqualsandGetHashCodecalls, which the C# compiler emits for every field of a genericrecord struct. ForF = Change<T_REF>the call binds toGenericEqualityComparer<Change<Change<T_REF>>>. On browser-wasm AOT the caller then asserts inmini_method_get_rgctxif the doubled type breaks a constraint, or traps withfunction signature mismatchif it changes layout.The fix applies only
method_instto an already-inflated slot method, asget_method_constrainedandMONO_RGCTX_INFO_VIRT_METHODalready do.Risk: closed types are unaffected, because re-inflating a closed method returns it unchanged. The same code is on release/8.0 through release/11.0, so this isn't a regression.
Testing: two new
ValueTypeTestscover the constraint failure and the layout failure. With a browser-wasmmono-aot-crossbuilt from the rc.3 source, both fail without the fix and pass with it. Both pass on CoreCLR. Not run: XHarness, iOS/Android, CI.Resolves #137123