Skip to content

R2R signature formatter labels Check_VirtualFunctionOverride fixups as Verify_VirtualFunctionOverride #136930

Closed

Description

@davidwrighton

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

  1. Read a ReadyToRun image containing a Check_VirtualFunctionOverride import with ReadyToRunReader.
  2. Format that import's signature using entry.Signature.ToString(new SignatureFormattingOptions()).
  3. 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.

Activity

  1. added
    untriaged
    on Nov 3, 2026
  2. dotnet-policy-service commented on Nov 3, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/crossgen-contrib
    See info in area-owners.md if you want to be subscribed.

  3. removed
    untriaged
    on Nov 5, 2026
  4. added a commit that references this issue on Nov 5, 2026
    e1d7f34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

  • Status
    No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions