Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Clean up terenary statement in dispatchinfo.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoritzinsky committed Oct 11, 2019
1 parent e93fda5 commit d493541
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/vm/dispatchinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2335,18 +2335,22 @@ void DispatchInfo::MarshalParamManagedToNativeRef(DispatchMemberInfo *pMemberInf
VARTYPE ElementVt = V_VT(pRefVar) & ~(VT_BYREF | VT_ARRAY);
MethodTable *pElementMT = (*(BASEARRAYREF *)pSrcObj)->GetArrayElementTypeHandle().GetMethodTable();

MethodDesc* pStructMarshalStub = nullptr;
PCODE pStructMarshalStubAddress = NULL;
GCPROTECT_BEGIN(*pSrcObj);
if ((ElementVt == VT_RECORD || ElementVt == VTHACK_NONBLITTABLERECORD) && (pElementMT != nullptr && !pElementMT->IsBlittable()))
{
GCX_PREEMP();

pStructMarshalStub = NDirect::CreateStructMarshalILStub(pElementMT);
MethodDesc* pStructMarshalStub = NDirect::CreateStructMarshalILStub(pElementMT);
if (pStructMarshalStub != nullptr)
{
pStructMarshalStubAddress = pStructMarshalStub->GetMultiCallableAddrOfCode();
}
}
GCPROTECT_END();

// Convert the contents of the managed array into the original SAFEARRAY.
OleVariant::MarshalSafeArrayForArrayRef((BASEARRAYREF *)pSrcObj, *V_ARRAYREF(pRefVar), ElementVt, pElementMT, pStructMarshalStub != nullptr ? pStructMarshalStub->GetMultiCallableAddrOfCode() : NULL);
OleVariant::MarshalSafeArrayForArrayRef((BASEARRAYREF *)pSrcObj, *V_ARRAYREF(pRefVar), ElementVt, pElementMT, pStructMarshalStubAddress);
}
else
{
Expand Down

0 comments on commit d493541

Please sign in to comment.