-
Couldn't load subscription status.
- Fork 5.2k
[clr-interp] Fix EH clause var construction #120028
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
Conversation
- These vars were not be accounted for in m_varsSize, which caused overlaps in the assigned vars - I also noticed that we were allocating these as global vars, and they don't need to be, so I've tweaked that as well This was causing generalized memory corruption around several tests with EH.
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 fixes a critical memory corruption issue in the CoreCLR interpreter's exception handling (EH) clause variable construction. The fix addresses two problems: EH clause variables weren't being counted in m_varsSize causing memory overlaps, and these variables were incorrectly allocated as global variables when they should be local.
Key Changes
- Added proper accounting for EH clause variables in
m_varsSizeto prevent memory overlaps - Changed EH clause variable allocation from global to local scope
- Added safety check to skip unallocated variables during GC info building
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
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
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.
LGTM, thank you!
This was causing generalized memory corruption around several tests with EH.