Skip to content
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

Ignore modopts/modreqs for UnsafeAccessor field targets #109694

Conversation

AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT commented Nov 11, 2024

Fixes #109665

The generated IL remains correct and doesn't require a .volatile prefix for the accessor. This is based off of what Roslyn currently emits if an accessor was manually written.

See SharpLab for an example.

The generated IL remains correct and doesn't
require a .volatile prefix for the generated accessor.
This is based off of what Roslyn currently emits if a
getter was available.
@AaronRobinsonMSFT
Copy link
Member Author

This might require an update to mono as well. I will look into that tomorrow.

@AaronRobinsonMSFT
Copy link
Member Author

/ba-g WASM timeouts

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit e6e3bb6 into dotnet:main Nov 11, 2024
146 of 151 checks passed
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the ignore_modopts_modreqs_field_lookup branch November 11, 2024 21:08
@AaronRobinsonMSFT
Copy link
Member Author

/backport to release/9.0

Copy link
Contributor

Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/11786200251

@AaronRobinsonMSFT
Copy link
Member Author

/backport to release/8.0-staging

Copy link
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/11786212482

Copy link
Contributor

@AaronRobinsonMSFT backporting to release/8.0-staging failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Ignore modopts/modreqs for `UnsafeAccessor` field targets
Using index info to reconstruct a base tree...
M	src/coreclr/vm/prestub.cpp
M	src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.cs
CONFLICT (content): Merge conflict in src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.cs
Auto-merging src/coreclr/vm/prestub.cpp
CONFLICT (content): Merge conflict in src/coreclr/vm/prestub.cpp
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Ignore modopts/modreqs for `UnsafeAccessor` field targets
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

@AaronRobinsonMSFT an error occurred while backporting to release/8.0-staging, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@AaronRobinsonMSFT
Copy link
Member Author

/backport to release/9.0-staging

Copy link
Contributor

Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/11786290011

mikelle-rogers pushed a commit to mikelle-rogers/runtime that referenced this pull request Dec 10, 2024
)

* Ignore modopts/modreqs for `UnsafeAccessor` field targets

The generated IL remains correct and doesn't require a
.volatile prefix for the accessor. This is based off of what Roslyn
currently emits if an accessor was manually written.
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2024
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.

UnsafeAccessorAttribute fails to access volatile field
4 participants