Skip to content

[release/7.0] Fix nested non-byref like VC with no pointer fields - #80873

Merged
carlossanlop merged 1 commit into
dotnet:release/7.0from
AaronRobinsonMSFT:net7_80642
Feb 8, 2023
Merged

[release/7.0] Fix nested non-byref like VC with no pointer fields#80873
carlossanlop merged 1 commit into
dotnet:release/7.0from
AaronRobinsonMSFT:net7_80642

Conversation

@AaronRobinsonMSFT

@AaronRobinsonMSFTAaronRobinsonMSFT commented Jan 19, 2023

Copy link
Copy Markdown
Member

Backport of #80642 that fixes#80624

Customer Impact

Customer reported issue with nested ref structs. A TypeLoadException can occur when a non-ByRefLike struct contains other structs marked with explicit layout. This was a regression introduced when adding ref field support in #65246.

Testing

New tests have been added for this failure case and others in the same area.

Risk

Low. The fix here is a permitting behavior that existed in .NET 6 but folding in the ref field logic. The changes to make that support are simple enough and should avoid the failing behavior that was acknowledged by an assert in debug builds. This implements the needed path.

* Fix nested non-byref like VC with no pointer fields
@AaronRobinsonMSFTAaronRobinsonMSFT added Servicing-consider Issue for next servicing release review area-TypeSystem-coreclr labels Jan 19, 2023
@AaronRobinsonMSFTAaronRobinsonMSFT added this to the 7.0.x milestone Jan 19, 2023

@trylektrylek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks just as good as the original version, thank you!

@jeffschwMSFTjeffschwMSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

approved. we will take for consideration in 7.0.x

@jeffschwMSFTjeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 20, 2023
@jeffschwMSFTjeffschwMSFT modified the milestones: 7.0.x, 7.0.4Jan 20, 2023
@carlossanlop

Copy link
Copy Markdown
Contributor

Approved by Tactics for 7.0.4.
Signed off by area owners.
No OOB changes needed.
CI failures known and unrelated: #81391 and #81544
Ready to merge. :shipit:

@carlossanlop
carlossanlop merged commit b1b4d63 into dotnet:release/7.0Feb 8, 2023
@ghostghost locked as resolved and limited conversation to collaborators Mar 11, 2023
@AaronRobinsonMSFT
AaronRobinsonMSFT deleted the net7_80642 branch April 9, 2023 05:40
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-TypeSystem-coreclrServicing-approvedApproved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@AaronRobinsonMSFT@carlossanlop@jeffschwMSFT@trylek