Skip to content

[interp] Fix boundary condition where a leave is not added to the leaves table - #120228

Merged
kg merged 2 commits into
dotnet:mainfrom
kg:interp-leaves-table-offbyone
Oct 1, 2025
Merged

kg merged 2 commits into
dotnet:mainfrom
kg:interp-leaves-table-offbyone

Conversation

@kg

@kg kg commented Sep 29, 2025

Copy link
Copy Markdown
Contributor

Fixes Interop\PInvoke\CriticalHandles\Test\Test

… if the leave target is the exact end of the try block
@kg
kg requested a review from BrzVlad as a code owner September 29, 2025 21:28
@kg
kg requested a review from janvorli as a code owner September 29, 2025 21:28
Copilot AI review requested due to automatic review settings September 29, 2025 21:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes a boundary condition bug in the CoreCLR interpreter where a leave instruction is not properly added to the leaves table when the leave target is at the exact end of a try region.

  • Changes the boundary check from <= to < to exclude the exact end position of try regions
  • Ensures proper finally call island block creation for leave instructions at try region boundaries

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@kg

kg commented Sep 29, 2025

Copy link
Copy Markdown
Contributor Author

Jan noticed another wrong comparison that I will fix once the test passes locally.

@kg kg mentioned this pull request Oct 1, 2025
41 of 69 tasks

@janvorli janvorli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@kg
kg merged commit a11d794 into dotnet:main Oct 1, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 1, 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.

3 participants