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

JIT: remove incorrect type deduction for an Unsafe.As case #93694

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

AndyAyersMS
Copy link
Member

Thanks to @SingleAccretion for the fix.

The JIT was assuming that an indirectly accessed value type field had the type of the field, but that might not be the case if the field was accessed via Unsafe.As.

Fix this by limiting type deduction from these indirectly accessed fields to only ref type fields.

Closes #93650.

Thanks to @SingleAccretion for the fix.

The JIT was assuming that an indirectly accessed value type field had
the type of the field, but that might not be the case if the field
was accessed via `Unsafe.As`.

Fix this by limiting type deduction from these indirectly accessed fields
to only ref type fields.

Closes dotnet#93650.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 18, 2023
@ghost ghost assigned AndyAyersMS Oct 18, 2023
@ghost
Copy link

ghost commented Oct 18, 2023

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

Issue Details

Thanks to @SingleAccretion for the fix.

The JIT was assuming that an indirectly accessed value type field had the type of the field, but that might not be the case if the field was accessed via Unsafe.As.

Fix this by limiting type deduction from these indirectly accessed fields to only ref type fields.

Closes #93650.

Author: AndyAyersMS
Assignees: AndyAyersMS
Labels:

area-CodeGen-coreclr

Milestone: -

@AndyAyersMS
Copy link
Member Author

@jakobbotsch PTAL
cc @dotnet/jit-contrib

@AndyAyersMS
Copy link
Member Author

No diffs or TP impact.

@AndyAyersMS AndyAyersMS merged commit 90c417a into dotnet:main Oct 18, 2023
134 of 139 checks passed
@AndyAyersMS
Copy link
Member Author

/backport to release/8.0

@github-actions
Copy link
Contributor

Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/6567332986

@ghost ghost locked as resolved and limited conversation to collaborators Nov 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsafe.As breaks callvirt after inlining in .NET 8 RC2
2 participants