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 block non-blittable pointer types in P/Invokes. #1866

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions src/coreclr/src/vm/mlinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1612,13 +1612,6 @@ MarshalInfo::MarshalInfo(Module* pModule,
// plus they are not marked as blittable.
if (!th.IsEnum())
{
// It should be blittable
if (!th.IsBlittable())
{
m_resID = IDS_EE_BADMARSHAL_PTRNONBLITTABLE;
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
IfFailGoto(E_FAIL, lFail);
}

// Check for Copy Constructor Modifier
if (sigtmp.HasCustomModifier(pModule, "Microsoft.VisualC.NeedsCopyConstructorModifier", ELEMENT_TYPE_CMOD_REQD) ||
sigtmp.HasCustomModifier(pModule, "System.Runtime.CompilerServices.IsCopyConstructed", ELEMENT_TYPE_CMOD_REQD) )
Expand All @@ -1634,17 +1627,6 @@ MarshalInfo::MarshalInfo(Module* pModule,
}
}
}
else
{
if (!(mtype2 != ELEMENT_TYPE_CLASS &&
mtype2 != ELEMENT_TYPE_STRING &&
mtype2 != ELEMENT_TYPE_OBJECT &&
mtype2 != ELEMENT_TYPE_SZARRAY))
{
m_resID = IDS_EE_BADMARSHAL_PTRSUBTYPE;
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
IfFailGoto(E_FAIL, lFail);
}
}
}
}

Expand Down