Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Aug 28, 2025

Backport of #119145 to release/10.0

/cc @jakobbotsch

Customer Impact

  • Customer reported
  • Found internally

In some cases a runtime async method may tailcall another runtime async method even though such a tailcall is incompatible. In particular a function returning an an int16 can tailcall a function returning an int8. If the runtime async function finishes asynchronously, then only an 8 bit result value will be propagated to a caller expecting a 16 bit result value.

Regression

  • Yes
  • No

Testing

Unit test added.

Risk

Low, only has an impact when runtime async is enabled.

The JIT allows tailcalls that depend on widening happening in the
callee: e.g. an int32 returning function can tailcall an int16 returning
function because the managed ABI specifies that the callee will widen
anyway.

However, this is not legal for async methods. For async methods the
int32 and int16 returning functions come with two different resumption
stubs that are responsible for propagating the returned result into the
next continuation in asynchronous cases. Allowing an int32 -> int16
tailcall means only a 16-bit value gets propagated into a caller that
expects 32 bits to be written into its continuation.

Fix #119060
@jakobbotsch jakobbotsch requested a review from EgorBo August 28, 2025 15:01
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. please get a code review. we can merge when ready

@jeffschwMSFT jeffschwMSFT added the Servicing-approved Approved for servicing release label Aug 28, 2025
@jeffschwMSFT jeffschwMSFT added this to the 10.0.0 milestone Aug 28, 2025
Copy link
Member

@JulieLeeMSFT JulieLeeMSFT left a comment

Choose a reason for hiding this comment

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

LGTM.

@jeffschwMSFT jeffschwMSFT merged commit c2b36dc into release/10.0 Aug 29, 2025
106 of 107 checks passed
@jkotas jkotas deleted the backport/pr-119145-to-release/10.0 branch August 31, 2025 22:51
@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants