Skip to content

Fix LDTOKEN in interpreter #116234

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

Merged
merged 1 commit into from
Jun 3, 2025
Merged

Fix LDTOKEN in interpreter #116234

merged 1 commit into from
Jun 3, 2025

Conversation

janvorli
Copy link
Member

@janvorli janvorli commented Jun 2, 2025

The CEE_LDTOKEN compilation incorrectly assumes that the resolved token contains either hClass or hField or hMethod and it checks for the hClass first. But the hClass is present always, so resolving token for method or field doesn't work correctly.

This change fixes it by reordering the checks in an order matching what JIT does.

The CEE_LDTOKEN compilation incorrectly assumes that the resolved token
contains either hClass or hField or hMethod and it checks for the hClass
first. But the hClass is present always, so resolving token for method
or field doesn't work correctly.

This change fixes it by reordering the checks in an order matching what JIT
does.
@janvorli janvorli added this to the 10.0.0 milestone Jun 2, 2025
@janvorli janvorli self-assigned this Jun 2, 2025
@Copilot Copilot AI review requested due to automatic review settings June 2, 2025 22:53
@janvorli janvorli requested review from BrzVlad and kg as code owners June 2, 2025 22:53
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 fixes the token resolution logic in the interpreter's LDTOKEN handling by reordering the conditional checks to correctly distinguish between field, method, and class tokens.

  • Reordered the conditionals to check for hField first, followed by hMethod and then hClass.
  • Updated helper functions and data index assignments accordingly.

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 2, 2025
Copy link
Member

@kg kg left a comment

Choose a reason for hiding this comment

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

Thanks for catching this!

@janvorli
Copy link
Member Author

janvorli commented Jun 3, 2025

/ba-g #116261, #102236

@janvorli janvorli merged commit b142ec3 into dotnet:main Jun 3, 2025
92 of 95 checks passed
@janvorli janvorli deleted the fix-ldtoken branch June 3, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants