summaryrefslogtreecommitdiff
path: root/src/md/winmd/adapter.cpp
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2016-12-27 16:46:08 +0900
committerJiyoung Yun <jy910.yun@samsung.com>2016-12-27 16:46:08 +0900
commitdb20f3f1bb8595633a7e16c8900fd401a453a6b5 (patch)
treee5435159cd1bf0519276363a6fe1663d1721bed3 /src/md/winmd/adapter.cpp
parent4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (diff)
downloadcoreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.gz
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.bz2
coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.zip
Imported Upstream version 1.0.0.9127upstream/1.0.0.9127
Diffstat (limited to 'src/md/winmd/adapter.cpp')
-rw-r--r--src/md/winmd/adapter.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/md/winmd/adapter.cpp b/src/md/winmd/adapter.cpp
index 5b4d95cc7c..2c9dd1b9fd 100644
--- a/src/md/winmd/adapter.cpp
+++ b/src/md/winmd/adapter.cpp
@@ -88,6 +88,8 @@ HRESULT CheckIfWinMDAdapterNeeded(IMDCommon *pRawMDCommon)
HRESULT hr;
LPWSTR wszCorVersion = NULL;
WinMDAdapter* pNewAdapter = NULL;
+ ULONG numAssemblyRefs = 0;
+ const char *szClrPortion = NULL;
*ppAdapter = NULL;
@@ -102,7 +104,7 @@ HRESULT CheckIfWinMDAdapterNeeded(IMDCommon *pRawMDCommon)
//------------------------------------------------------------------------------------------------
LPCSTR szVersion;
IfFailGo(pRawMDCommon->GetVersionString(&szVersion));
- const char *szClrPortion = strchr(szVersion, ';');
+ szClrPortion = strchr(szVersion, ';');
if (szClrPortion)
{
pNewAdapter->m_scenario = kWinMDExp;
@@ -148,7 +150,7 @@ HRESULT CheckIfWinMDAdapterNeeded(IMDCommon *pRawMDCommon)
//------------------------------------------------------------------------------------------------
// Find an assemblyRef to mscorlib (required to exist in .winmd files precisely to make the adapter's job easier.
//------------------------------------------------------------------------------------------------
- ULONG numAssemblyRefs = pNewAdapter->m_pRawMetaModelCommonRO->CommonGetRowCount(mdtAssemblyRef);
+ numAssemblyRefs = pNewAdapter->m_pRawMetaModelCommonRO->CommonGetRowCount(mdtAssemblyRef);
pNewAdapter->m_assemblyRefMscorlib = 0;
pNewAdapter->m_fReferencesMscorlibV4 = FALSE;
for (ULONG rid = 1; rid <= numAssemblyRefs; rid++)
@@ -860,10 +862,11 @@ WinMDAdapter::GetTypeRefProps(
HRESULT hr;
ULONG treatment;
+ ULONG treatmentClass;
IfFailGo(GetTypeRefTreatment(tkTypeRef, &treatment));
_ASSERTE(treatment != kTrNotYetInitialized);
- ULONG treatmentClass = treatment & kTrClassMask;
+ treatmentClass = treatment & kTrClassMask;
if (treatmentClass == kTrClassWellKnownRedirected)
{
ULONG nRewritePairIndex = treatment & ~kTrClassMask;
@@ -998,9 +1001,10 @@ WinMDAdapter::GetTypeRefRedirectedInfo(
HRESULT hr;
ULONG treatment;
+ ULONG treatmentClass;
IfFailGo(GetTypeRefTreatment(tkTypeRef, &treatment));
- ULONG treatmentClass = treatment & kTrClassMask;
+ treatmentClass = treatment & kTrClassMask;
if (treatmentClass == kTrClassWellKnownRedirected)
{
*pIndex = (RedirectedTypeIndex)(treatment & ~kTrClassMask);
@@ -1278,11 +1282,14 @@ HRESULT WinMDAdapter::ModifyMethodProps(mdMethodDef tkMethodDef, /*[in, out]*/ D
_ASSERTE(TypeFromToken(tkMethodDef) == mdtMethodDef);
ULONG mdTreatment;
+ DWORD dwAttr;
+ DWORD dwImplFlags;
+ ULONG ulRVA;
IfFailGo(GetMethodDefTreatment(tkMethodDef, &mdTreatment));
- DWORD dwAttr = pdwAttr ? *pdwAttr: 0;
- DWORD dwImplFlags = pdwImplFlags ? *pdwImplFlags : 0;
- ULONG ulRVA = pulRVA ? *pulRVA : 0;
+ dwAttr = pdwAttr ? *pdwAttr: 0;
+ dwImplFlags = pdwImplFlags ? *pdwImplFlags : 0;
+ ulRVA = pulRVA ? *pulRVA : 0;
switch (mdTreatment & kMdTreatmentMask)
{
@@ -2400,9 +2407,12 @@ HRESULT WinMDAdapter::TranslateWinMDAttributeUsageAttribute(mdTypeDef tkTypeDefO
{
IfFailGo(COR_E_BADIMAGEFORMAT);
}
- DWORD wfTargetValue = *(DWORD*)(pbWFUsageBlob + 2);
- *pClrTargetValue = ConvertToClrAttributeTarget(wfTargetValue);
+ {
+ DWORD wfTargetValue = *(DWORD*)(pbWFUsageBlob + 2);
+ *pClrTargetValue = ConvertToClrAttributeTarget(wfTargetValue);
+ }
+
// add AttributeTargets.Method, AttributeTargets.Constructor , AttributeTargets.Property, and AttributeTargets.Event if this is the VersionAttribute
LPCSTR szNamespace;
LPCSTR szName;