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

Add tests for ref field overlap with OBJECTREF and non-aligned ref fields. #64643

Merged
merged 5 commits into from
Feb 2, 2022

Conversation

AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT commented Feb 1, 2022

@AaronRobinsonMSFT
Copy link
Member Author

/cc @fanyang-mono

@MichalStrehovsky
Copy link
Member

Ah, almost forgot - crossgen2/NativeAOT has equivalent check that was added in dotnet/coreclr#27054. Could you please update that one too?

@AaronRobinsonMSFT
Copy link
Member Author

@MichalStrehovsky Seems like CrossGen2 is already correct?

else if (fieldType.IsByRef)
{
if (offset % _pointerSize != 0)
{
// Misaligned pointer field
ThrowFieldLayoutError(offset);
}
SetFieldLayout(offset, _pointerSize, FieldLayoutTag.NonORef);
}

@MichalStrehovsky
Copy link
Member

MichalStrehovsky commented Feb 2, 2022

@MichalStrehovsky Seems like CrossGen2 is already correct?

Heh, looks like it. I don't know why we did so much untestable futureproofing (including the previous in JitInterface) but I guess it's nice now.

Copy link
Member

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

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

Thank you!

@AaronRobinsonMSFT AaronRobinsonMSFT changed the title Add tests for overlap and non-aligned ref fields. Add tests for ref field overlap with OBJECTREF and non-aligned ref fields. Feb 2, 2022
@AaronRobinsonMSFT
Copy link
Member Author

The WasmBuildTests PR leg failures predate this PR according to AzDO history.
The Linux ARM for Vector* intrinsics appear to be occurring on other PRs.

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit 283e5c7 into dotnet:main Feb 2, 2022
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the runtime64520 branch February 2, 2022 16:27
@ghost ghost locked as resolved and limited conversation to collaborators Mar 4, 2022
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.

Prevent placing ref fields on non-pointer boundaries
3 participants