Skip to content

[clr-interp] Fix behavior of PNSE for intrinsics#120277

Merged
davidwrighton merged 2 commits intodotnet:mainfrom
davidwrighton:Fix_PNSE_InInterpreter
Oct 2, 2025
Merged

[clr-interp] Fix behavior of PNSE for intrinsics#120277
davidwrighton merged 2 commits intodotnet:mainfrom
davidwrighton:Fix_PNSE_InInterpreter

Conversation

@davidwrighton
Copy link
Member

  • We automatically detected that intrinsics should throw PNSE, but we didn't correctly handle the IL stack in those cases

- We automatically detected that intrinsics should throw PNSE, but we didn't correctly handle the IL stack in those cases
Copilot AI review requested due to automatic review settings September 30, 2025 23:01
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 the behavior of the Platform Not Supported Exception (PNSE) for intrinsics in the CoreCLR interpreter by properly handling the IL stack when these exceptions are thrown.

  • Adds proper IL stack manipulation to simulate method execution before throwing PNSE
  • Handles both argument removal and return value placement on the stack
  • Maintains correct stack state for subsequent interpreter operations

@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 Sep 30, 2025
@davidwrighton davidwrighton added area-CodeGen-Interpreter-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Sep 30, 2025
@dotnet-policy-service
Copy link
Contributor

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

@davidwrighton davidwrighton enabled auto-merge (squash) September 30, 2025 23:44
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
@davidwrighton davidwrighton merged commit d8f4d2c into dotnet:main Oct 2, 2025
96 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 2, 2025
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.

4 participants