[clr-interp] Fix EH clause var construction#120028
Merged
davidwrighton merged 3 commits intodotnet:mainfrom Sep 24, 2025
Merged
[clr-interp] Fix EH clause var construction#120028davidwrighton merged 3 commits intodotnet:mainfrom
davidwrighton merged 3 commits intodotnet:mainfrom
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.
Contributor
There was a problem hiding this comment.
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
69 tasks
janvorli
reviewed
Sep 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was causing generalized memory corruption around several tests with EH.