Skip to content

Conversation

@jkoritzinsky
Copy link
Member

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.

This PR fixes the regression by falling back to dynamically marshalling the object if the runtime type does not match the declared type.

Fixes #49857

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.

Incorrect PInvoke when parameter has base class with no members

2 participants