Skip to content

Conversation

@AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT commented Nov 23, 2021

During the clean up phase for IL marshallers, managed value types passed as nullptr can cause failures.
This is an issue with field marshallers of nested non-blittable types only.

else if (th.HasLayout())
{
MethodDesc* structMarshalStub;
{
GCX_PREEMP();
structMarshalStub = NDirect::CreateStructMarshalILStub(th.GetMethodTable());
}
MarshalStructViaILStub(structMarshalStub, nullptr, ptr, StructMarshalStubs::MarshalOperation::Cleanup);
}

Fixes #61839

/cc @jkoritzinsky @elinor-fung

  managed valuetypes. This is an issue with field marshallers of
  nested non-blittable types.
@AaronRobinsonMSFT
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1497375119

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.

NullReferenceException in Marshal.DestroyStructure with embedded structs containing delegates

2 participants