diff options
Diffstat (limited to 'src/md/winmd/winmdimport.cpp')
-rw-r--r-- | src/md/winmd/winmdimport.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/md/winmd/winmdimport.cpp b/src/md/winmd/winmdimport.cpp index fe80bf0b04..cc983d2bfc 100644 --- a/src/md/winmd/winmdimport.cpp +++ b/src/md/winmd/winmdimport.cpp @@ -588,13 +588,15 @@ class WinMDImport : public IMetaDataImport2 *pmb = mdMethodDefNil; - // check to see if this is a vararg signature - PCCOR_SIGNATURE pvSigTemp = pvSigBlob; - if (isCallConv(CorSigUncompressCallingConv(pvSigTemp), IMAGE_CEE_CS_CALLCONV_VARARG)) { - // Get the fixed part of VARARG signature - IfFailGo(_GetFixedSigOfVarArg(pvSigBlob, cbSigBlob, &qbSig, &cbSigBlob)); - pvSigBlob = (PCCOR_SIGNATURE) qbSig.Ptr(); + // check to see if this is a vararg signature + PCCOR_SIGNATURE pvSigTemp = pvSigBlob; + if (isCallConv(CorSigUncompressCallingConv(pvSigTemp), IMAGE_CEE_CS_CALLCONV_VARARG)) + { + // Get the fixed part of VARARG signature + IfFailGo(_GetFixedSigOfVarArg(pvSigBlob, cbSigBlob, &qbSig, &cbSigBlob)); + pvSigBlob = (PCCOR_SIGNATURE) qbSig.Ptr(); + } } // now iterate all methods in td and compare name and signature @@ -1654,15 +1656,17 @@ class WinMDImport : public IMetaDataImport2 // Step 1: Call EnumAssemblyRefs with an empty buffer to create the HENUMInternal IfFailGo(m_pRawAssemblyImport->EnumAssemblyRefs(phEnum, NULL, 0, NULL)); - // Step 2: Increment the cound to include the extra assembly refs - HENUMInternal *phInternalEnum = static_cast<HENUMInternal*>(*phEnum); + { + // Step 2: Increment the count to include the extra assembly refs + HENUMInternal *phInternalEnum = static_cast<HENUMInternal*>(*phEnum); - _ASSERTE(phInternalEnum->m_EnumType == MDSimpleEnum); + _ASSERTE(phInternalEnum->m_EnumType == MDSimpleEnum); - _ASSERTE( phInternalEnum->m_ulCount == m_pWinMDAdapter->GetRawAssemblyRefCount()); - int n = m_pWinMDAdapter->GetExtraAssemblyRefCount(); - phInternalEnum->m_ulCount += n; - phInternalEnum->u.m_ulEnd += n; + _ASSERTE( phInternalEnum->m_ulCount == m_pWinMDAdapter->GetRawAssemblyRefCount()); + int n = m_pWinMDAdapter->GetExtraAssemblyRefCount(); + phInternalEnum->m_ulCount += n; + phInternalEnum->u.m_ulEnd += n; + } // Step 3: Call EnumAssemblyRefs again and pass in the modifed HENUMInternal and the real buffer IfFailGo(m_pRawAssemblyImport->EnumAssemblyRefs(phEnum, rAssemblyRefs, cMax, pcTokens)); |