Uh oh!
There was an error while loading. Please reload this page.
[release/7.0-preview2] Class types with layout that inherit from System.Object should be ManagedSequential - #65578
Conversation
ghost
commented
Feb 18, 2022
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
jkoritzinsky
commented
Feb 18, 2022
cc: @mangod9 I don't remember who needs to approve for servicing preview releases. Can you approve or do we need @jeffschwMSFT approval? |
mangod9
commented
Feb 18, 2022
I dont have access to merge though |
jeffschwMSFT
commented
Feb 21, 2022
@jkoritzinsky the window to make Preview 2 has basically passed. How impactful is this? |
jkoritzinsky
commented
Feb 21, 2022
This can cause issues anywhere where LayoutKind.Sequential is used with ReadyToRun code, so not everywhere but at least somewhat common. I don't think this is release blocking though as the same bug was in Preview 1 and the fix is already in main. |
jeffschwMSFT
commented
Feb 21, 2022
I think in this case, let' wait for main to flow into Preview 3. |
jkoritzinsky
commented
Feb 21, 2022
Sounds good. I’ll close this then. |
Backport of #65447 to release/7.0-preview2
/cc @jkoritzinsky
Layout-classes marked as
LayoutKind.Sequentialwith a System.Object base class should use a sequential layout for managed code.Customer Impact
Users who use crossgen2 to Ready-to-Run their code before execution may experience unexpected failures when using
[StructLayout(LayoutKind.Sequential)]onclasstypes when interacting with non-R2R code.This is a regression reported in #65412
Testing
This PR includes tests to validate layout expectations.
Risk
Low risk.
IMPORTANT: If this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.