Skip to content

Fix access flags passed to getFieldInfo in interpreter - #122009

Merged
jkotas merged 1 commit into
dotnet:mainfrom
janvorli:fix-getfieldinfo-access-flags
Nov 27, 2025
Merged

jkotas merged 1 commit into
dotnet:mainfrom
janvorli:fix-getfieldinfo-access-flags

Conversation

@janvorli

Copy link
Copy Markdown
Member

The interpreter compiler incorrectly passes CORINFO_ACCESS_GET to the getFieldInfo for CEE_STSFLD and CEE_STFLD opcodes. That causes failure in one of the libraries tests that initializes
BitConverter.IsLittleEndian field.

This change puts in the correct CORINFO_ACCESS_SET flag.

The interpreter compiler incorrectly passes CORINFO_ACCESS_GET to the
getFieldInfo for CEE_STSFLD and CEE_STFLD opcodes. That causes failure
in one of the libraries tests that initializes
BitConverter.IsLittleEndian field.

This change puts in the correct CORINFO_ACCESS_SET flag.
@janvorli janvorli added this to the 11.0.0 milestone Nov 26, 2025
@janvorli janvorli self-assigned this Nov 26, 2025
@janvorli
janvorli requested review from BrzVlad and kg as code owners November 26, 2025 23:40
Copilot AI review requested due to automatic review settings November 26, 2025 23:40
@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.

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

This PR fixes a bug in the CoreCLR interpreter where incorrect access flags were passed to getFieldInfo for field store operations. The interpreter was incorrectly using CORINFO_ACCESS_GET (indicating a read operation) instead of CORINFO_ACCESS_SET (indicating a write operation) for the CEE_STFLD and CEE_STSFLD IL opcodes.

Key changes:

  • Corrected the access flag for CEE_STFLD (store instance field) from CORINFO_ACCESS_GET to CORINFO_ACCESS_SET
  • Corrected the access flag for CEE_STSFLD (store static field) from CORINFO_ACCESS_GET to CORINFO_ACCESS_SET

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@janvorli

Copy link
Copy Markdown
Member Author

/ba-g the failure is an infra timeout during android build, unrelated to this change.

@jkotas
jkotas merged commit 39ad112 into dotnet:main Nov 27, 2025
@janvorli
janvorli deleted the fix-getfieldinfo-access-flags branch November 27, 2025 09:26
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 28, 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