Repository navigation
Description
Description
ILCompiler.Reflection.ReadyToRun formats Check_VirtualFunctionOverride fixups as VERIFY_VIRTUAL_FUNCTION_OVERRIDE. This also affects tools that use its signature formatter, including R2RDump.
The distinction matters: a failed Check rejects the precompiled method, whereas a failed Verify causes a fatal runtime failure. The formatting currently reports the wrong contract.
Reproduction Steps
- Read a ReadyToRun image containing a
Check_VirtualFunctionOverrideimport withReadyToRunReader. - Format that import's signature using
entry.Signature.ToString(new SignatureFormattingOptions()). - Compare the printed label with the encoded fixup kind.
This was observed in the CoreCLR Wasm composite Havit build from Blazor-Playground/macro-benchmarks, compiled with the branch for #135553. All five virtual-resolution checks have encoded kind 0x33 (Check_VirtualFunctionOverride, after masking any module-override flag), but print VERIFY_VIRTUAL_FUNCTION_OVERRIDE.
One affected entry checks the default-interface resolution of INumberBase<char>.CreateTruncating<int>:
!0 System.Numerics.INumberBase`1<char>.CreateTruncating<!!0>(!!0)<int> ImplType :char ImplMethod :!0 System.Numerics.INumberBase`1<char>.CreateTruncating<!!0>(!!0)<int> (VERIFY_VIRTUAL_FUNCTION_OVERRIDE)
The other observed entries involve CreateTruncating<char> and INumberBase<Decimal32/64/128>.TryParse.
Expected behavior
Encoded kind 0x33 prints CHECK_VIRTUAL_FUNCTION_OVERRIDE; encoded kind 0x34 prints VERIFY_VIRTUAL_FUNCTION_OVERRIDE.
Actual behavior
Both kinds print VERIFY_VIRTUAL_FUNCTION_OVERRIDE.
Regression?
Unknown. The incorrect condition is also present in upstream commit 88721532dc18bf2ff259e110d2458c118a9c2870; it is not specific to the direct-call branch.
Known Workarounds
Inspect the actual fixup kind rather than inferring it from the formatted label.
Configuration
.NET 11 development build; CoreCLR browser-wasm Release image inspected on Linux x64. The faulty formatting condition is platform-independent.
Other information
In ReadyToRunSignature.cs, the shared Check_VirtualFunctionOverride / Verify_VirtualFunctionOverride case selects the label using:
if (fixupType == ReadyToRunFixupKind.Check_TypeLayout)
builder.Append(" (CHECK_VIRTUAL_FUNCTION_OVERRIDE)");
else
builder.Append(" (VERIFY_VIRTUAL_FUNCTION_OVERRIDE)");Check_TypeLayout cannot match either case handled here. The condition should compare with Check_VirtualFunctionOverride. A focused formatter test should cover both Check and Verify.
This report concerns diagnostic labeling only; no product code was changed.
Note
This issue was generated by GitHub Copilot from a local image inspection and source-code investigation.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
dotnet-policy-service commentedon Nov 3, 2026
Tagging subscribers to this area: @dotnet/crossgen-contrib
See info in area-owners.md if you want to be subscribed.
finding: .NET R2R formatter mislabels Check_VirtualFunctionOverride a…
Correct ReadyToRun virtual override fixup labels (dotnet#136931)