-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Few interpreter EH fixes #120684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Few interpreter EH fixes #120684
Conversation
janvorli
commented
Oct 14, 2025
- 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
There was a problem hiding this 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 |
Tagging subscribers to this area: @BrzVlad, @janvorli, @kg |