Skip to content

Fix handling of TypedReference returns in call stubs - #127603

Merged
BrzVlad merged 1 commit into
dotnet:mainfrom
BrzVlad:fix-clrinterp-typedbyref
May 4, 2026
Merged

BrzVlad merged 1 commit into
dotnet:mainfrom
BrzVlad:fix-clrinterp-typedbyref

Conversation

@BrzVlad

@BrzVlad BrzVlad commented Apr 30, 2026

Copy link
Copy Markdown
Member

We special case it as consisting of 2 I8s. Fixes System.Resources.Extensions.BinaryFormat.Tests crashes when a method returning TypedReference gets called from interpreter via JIT.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @BrzVlad, @janvorli, @kg
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates CoreCLR’s interpreter/JIT call stub return-type classification to correctly handle methods returning TypedReference, which is a 2-pointer (16-byte on 64-bit) return value, preventing crashes seen in System.Resources.Extensions.BinaryFormat.Tests.

Changes:

  • Removes ELEMENT_TYPE_TYPEDBYREF from the “treat like pointer/ref” return-type bucket.
  • Adds explicit handling for ELEMENT_TYPE_TYPEDBYREF, intending to classify it as two 8-byte integer returns on 64-bit.

Comment thread src/coreclr/vm/callstubgenerator.cpp Resolved
Comment thread src/coreclr/vm/callstubgenerator.cpp Resolved
Comment thread src/coreclr/vm/callstubgenerator.cpp Resolved
We special case it as consisting of 2 I8s.
Copilot AI review requested due to automatic review settings May 4, 2026 05:16
@BrzVlad
BrzVlad force-pushed the fix-clrinterp-typedbyref branch from 70cb497 to 0519fc2 Compare May 4, 2026 05:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/coreclr/vm/callstubgenerator.cpp Resolved
@BrzVlad

BrzVlad commented May 4, 2026

Copy link
Copy Markdown
Member Author

@janvorli Could you take a look ? Thanks!

@janvorli janvorli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thank you!

@BrzVlad
BrzVlad merged commit f0620ea into dotnet:main May 4, 2026
104 of 107 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 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.

3 participants