Skip to content

Conversation

@jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Dec 4, 2025

We were using CorSigUncompressData on the calling convention byte, but this is not stored as a normal compressed integer. It happened to work because compressed integers are specified by having their upper bit set, and metadata signatures never have that bit set in their calling convention. However, for some internal cases we repurpose that bit (specifically to specify that a signature has a generic context parameter).

Fix #122050

…n `PrettyPrintSignature`

We were using `CorSigUncompressData` on the calling convention byte, but
this is not stored as a normal compressed integer. It happened to work
because compressed integers are specified by having their upper bit set,
and metadata signatures never have that bit set. However, for some
internal cases we repurpose that bit (specifically to specify that a
signature has a generic context parameter).
Copilot AI review requested due to automatic review settings December 4, 2025 13:28
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Dec 4, 2025
@jakobbotsch jakobbotsch added area-VM-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Dec 4, 2025
@jakobbotsch jakobbotsch requested review from VSadov and jkotas December 4, 2025 13:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where calling convention bytes in signatures were being incorrectly decompressed using CorSigUncompressData instead of the proper CorSigUncompressCallingConv function. The issue is corrected in the PrettyPrintSignature function by replacing two instances where the wrong decompression function was used.

Key Changes:

  • Replaced CorSigUncompressData with CorSigUncompressCallingConv for reading calling convention bytes
  • Calling conventions are single bytes, not compressed integers, so the specialized function is required

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@VSadov VSadov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jakobbotsch jakobbotsch merged commit effdfe2 into dotnet:main Dec 4, 2025
107 of 110 checks passed
@jakobbotsch jakobbotsch deleted the fix-122050 branch December 4, 2025 17:45
@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RuntimeAsync] Assert !isCallConv(callConv, IMAGE_CEE_CS_CALLCONV_LOCAL_SIG)

3 participants