Skip to content

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 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 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
@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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