Skip to content

Prevent placing ref fields on non-pointer boundaries #64520

Description

@MichalStrehovsky

Similar to #12842 except for the following struct:

[StructLayout(LayoutKind.Explicit)]
ref struct RefStruct
{
    [FieldOffset(0)]
    public short X;
    [FieldOffset(2)]
    ref int Y;
}

We should not allow this to load.

Activity

  1. added this to the 7.0.0 milestone on Jan 31, 2022
  2. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Jan 31, 2022
  3. AaronRobinsonMSFT commented on Jan 31, 2022

    @AaronRobinsonMSFT
    Member

    I have the CoreCLR fix for this. The Mono changes are bit more complex and taking some time.

  4. MichalStrehovsky commented on Feb 1, 2022

    @MichalStrehovsky
    MemberAuthor

    I have the CoreCLR fix for this. The Mono changes are bit more complex and taking some time.

    FWIW, Mono doesn't even detect #12842.

    There's not even a bug for it because I don't think Mono ever ran a Pri-1 CoreCLR test pass (the regression test is Pri-1). If you make your regression test Pri-1, you can save yourself some work. It's not a Pri-0 scenario.

  5. AaronRobinsonMSFT commented on Feb 1, 2022

    @AaronRobinsonMSFT
    Member

    @MichalStrehovsky I've spent most of the day getting Mono in the right state. I am hitting issues now that are really confusing. I am close to doing what you suggest. Likely will make the call tomorrow.

  6. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Feb 1, 2022
  7. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Feb 2, 2022
  8. ghost locked as resolved and limited conversation to collaborators on Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions