-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[release/5.0] When marshalling a layout class, fall-back to dynamically marshalling the type if it doesn't match the static type in the signature. #50138
Conversation
… the type if it doesn't match the static type in the signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. I will take for consideration in 5.0.x.
No merge until #50410 is fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. Please complete cr.
@leecow we had approved this issue. Then in the time since a customer came back with an issue in master that applies to this change. We have updated the PR (the original intent of the change remains the same). I suggest that we consider this issue approved based on our original discussion. Though happy to bring it back if further discussion is warranted. |
@jkoritzinsky is this PR now in a mergeable state? |
Yes, this PR is in a mergable state. Just waiting on an updated code review @AaronRobinsonMSFT |
@Anipik once we have @AaronRobinsonMSFT cr, this pr will be ready for merge. We found an issue and have sense included an updated commit to address it. |
@Anipik this pr is ready to merge. Thanks |
i will merge the pr after the ci is complete. |
* [release/5.0] Use adjusted parent layout size to handle a non-zero-sized class inheriting from a zero-sized class that inherits from another zero-sized class. Fixes handling of zero-sized parent types that have zero-sized parent types. * Revert "[release/5.0] When marshalling a layout class, fall-back to dynamically marshalling the type if it doesn't match the static type in the signature. (#50138)" (#50883) (#51021) This reverts commit b71bb59.
Port of #50137, #50655, and #50735 to release/5.0
When we switched the struct marshalling system to be IL based, we accidentally stopped checking if the passed in object matched the type in the signature in the "layout class" case (where we have a sequential or explicit layout
class
type). This causes failures to marshal the derived types correctly since only the base type ends up being marshalled.Customer Impact
Without this change, developers need to manually marshal their types. An internal team (Halo) has worked around this by manually marshalling their types, but would prefer to remove this workaround.
Regression?
This was a regression from .NET Core 3.1.
See #49857
Testing
Tests for both the fix and backwards compatibility are included with this change.
Risk
Medium. This change affects marshalling of layout classes.