Skip to content

Conversation

janvorli
Copy link
Member

  • Correctly normalize objects that are not derived from Exception class before throwing them from the interpreter
  • Ensure managed exceptions from QCALLs invoked by the interpreter are properly handled
  • Add null check to INTOP_ZEROBLK_IMM

* Correctly normalize objects that are not derived from Exception class
  before throwing them from the interpreter
* Ensure managed exceptions from QCALLs invoked by the interpreter are
  properly handled
* Add null check to INTOP_ZEROBLK_IMM
@janvorli janvorli added this to the 11.0.0 milestone Oct 14, 2025
@janvorli janvorli self-assigned this Oct 14, 2025
@janvorli janvorli requested a review from BrzVlad as a code owner October 14, 2025 00:56
@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 00:56
@janvorli janvorli requested a review from kg as a code owner October 14, 2025 00:56
Copy link
Contributor

@Copilot 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 implements several exception handling fixes for the interpreter in CoreCLR. The changes ensure proper normalization of thrown objects and improved handling of managed exceptions from native calls.

Key changes:

  • Extracts duplicated exception normalization logic into a reusable NormalizeThrownObject function
  • Adds proper exception handling for QCALL invocations within the interpreter using PAL_TRY/PAL_EXCEPT
  • Adds null pointer validation to the INTOP_ZEROBLK_IMM interpreter operation

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/coreclr/vm/jithelpers.cpp Refactors IL_Throw to use the new NormalizeThrownObject function, removing duplicate code
src/coreclr/vm/interpexec.cpp Adds exception handling for unmanaged method transitions, null check for INTOP_ZEROBLK_IMM, and proper normalization for interpreter throws
src/coreclr/vm/exceptionhandling.h Declares the new NormalizeThrownObject function
src/coreclr/vm/exceptionhandling.cpp Implements the NormalizeThrownObject function with the extracted logic

Copy link
Contributor

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

@janvorli janvorli merged commit 5b6403b into dotnet:main Oct 14, 2025
95 of 97 checks passed
@janvorli janvorli deleted the interpreter-eh-fixes-1 branch October 14, 2025 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants