Skip to content
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

Don't pass the managed array object down when clearing a native array field. #33830

Merged
2 commits merged into from
Mar 20, 2020

Conversation

jkoritzinsky
Copy link
Member

We can construct all of the information we need from the method table and the managed object isn't actually used anywhere. Additionally, we don't always have a managed object when clearing the native object, see #33703

Fixes #33703

@AaronRobinsonMSFT
Copy link
Member

@jkoritzinsky This looks okay to me. In this case, I think we should also have a simple test to validate at least the scenario that was reported is valid. What class of marshaling is missing from our test coverage that missed this?

@jkoritzinsky
Copy link
Member Author

This case in particular is a non-blittable struct with an array field nested within another struct at a non-zero offset. I'll add the repro as a test case where our test cases for Marshal.DestroyStructure live.

@ghost
Copy link

ghost commented Mar 19, 2020

Hello @jkoritzinsky!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 35df31c into dotnet:master Mar 20, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
@jkoritzinsky jkoritzinsky deleted the fix-marshal-destroy branch January 21, 2021 19:29
This pull request was closed.
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.

Regression: DestoryStructure() crashing
2 participants