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

Commit d493541

Browse files
committed
Clean up terenary statement in dispatchinfo.cpp
1 parent e93fda5 commit d493541

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/vm/dispatchinfo.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,18 +2335,22 @@ void DispatchInfo::MarshalParamManagedToNativeRef(DispatchMemberInfo *pMemberInf
23352335
VARTYPE ElementVt = V_VT(pRefVar) & ~(VT_BYREF | VT_ARRAY);
23362336
MethodTable *pElementMT = (*(BASEARRAYREF *)pSrcObj)->GetArrayElementTypeHandle().GetMethodTable();
23372337

2338-
MethodDesc* pStructMarshalStub = nullptr;
2338+
PCODE pStructMarshalStubAddress = NULL;
23392339
GCPROTECT_BEGIN(*pSrcObj);
23402340
if ((ElementVt == VT_RECORD || ElementVt == VTHACK_NONBLITTABLERECORD) && (pElementMT != nullptr && !pElementMT->IsBlittable()))
23412341
{
23422342
GCX_PREEMP();
23432343

2344-
pStructMarshalStub = NDirect::CreateStructMarshalILStub(pElementMT);
2344+
MethodDesc* pStructMarshalStub = NDirect::CreateStructMarshalILStub(pElementMT);
2345+
if (pStructMarshalStub != nullptr)
2346+
{
2347+
pStructMarshalStubAddress = pStructMarshalStub->GetMultiCallableAddrOfCode();
2348+
}
23452349
}
23462350
GCPROTECT_END();
23472351

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

0 commit comments

Comments
 (0)