diff options
author | Sasha Semennikov <alsemenn@microsoft.com> | 2016-06-03 10:45:48 -0700 |
---|---|---|
committer | Sasha Semennikov <alsemenn@microsoft.com> | 2016-06-08 14:24:19 -0700 |
commit | 8ab40acd69273f941c3d815f448e0d27431ba5b6 (patch) | |
tree | 0904293713a2df532f85aff02f28d9a575982322 /src/debug | |
parent | af37c3b7bf4160f4af0f517526e304bcba271bb5 (diff) | |
download | coreclr-8ab40acd69273f941c3d815f448e0d27431ba5b6.tar.gz coreclr-8ab40acd69273f941c3d815f448e0d27431ba5b6.tar.bz2 coreclr-8ab40acd69273f941c3d815f448e0d27431ba5b6.zip |
Reduce memory leak for issue #1379
Remove unused header
Use proper exception-handling macroses
Fix build issues
Squash commits
Diffstat (limited to 'src/debug')
-rw-r--r-- | src/debug/daccess/request.cpp | 36 | ||||
-rw-r--r-- | src/debug/daccess/task.cpp | 11 |
2 files changed, 27 insertions, 20 deletions
diff --git a/src/debug/daccess/request.cpp b/src/debug/daccess/request.cpp index b49b30283f..9e864769c4 100644 --- a/src/debug/daccess/request.cpp +++ b/src/debug/daccess/request.cpp @@ -102,24 +102,24 @@ BOOL DacValidateEEClass(EEClass *pEEClass) // The EEClass method table pointer should match the method table. // TODO: Microsoft, need another test for validity, this one isn't always true anymore. BOOL retval = TRUE; - PAL_CPP_TRY + EX_TRY { MethodTable *pMethodTable = pEEClass->GetMethodTable(); if (!pMethodTable) { // PREfix. - return FALSE; + retval = FALSE; } - if (pEEClass != pMethodTable->GetClass()) + else if (pEEClass != pMethodTable->GetClass()) { retval = FALSE; } } - PAL_CPP_CATCH_ALL + EX_CATCH { retval = FALSE; // Something is wrong } - PAL_CPP_ENDTRY + EX_END_CATCH(SwallowAllExceptions) return retval; } @@ -128,7 +128,7 @@ BOOL DacValidateMethodTable(MethodTable *pMT, BOOL &bIsFree) { // Verify things are right. BOOL retval = FALSE; - PAL_CPP_TRY + EX_TRY { bIsFree = FALSE; EEClass *pEEClass = pMT->GetClass(); @@ -169,11 +169,11 @@ BOOL DacValidateMethodTable(MethodTable *pMT, BOOL &bIsFree) BadMethodTable: ; } - PAL_CPP_CATCH_ALL + EX_CATCH { retval = FALSE; // Something is wrong } - PAL_CPP_ENDTRY + EX_END_CATCH(SwallowAllExceptions) return retval; } @@ -187,7 +187,7 @@ BOOL DacValidateMD(MethodDesc * pMD) // Verify things are right. BOOL retval = TRUE; - PAL_CPP_TRY + EX_TRY { MethodTable *pMethodTable = pMD->GetMethodTable(); @@ -232,11 +232,11 @@ BOOL DacValidateMD(MethodDesc * pMD) } } } - PAL_CPP_CATCH_ALL + EX_CATCH { retval = FALSE; // Something is wrong } - PAL_CPP_ENDTRY + EX_END_CATCH(SwallowAllExceptions) return retval; } @@ -1231,11 +1231,11 @@ ClrDataAccess::GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, MethodDesc* pMD = PTR_MethodDesc(TO_TADDR(methodDesc)); StackSString str; - PAL_CPP_TRY + EX_TRY { TypeString::AppendMethodInternal(str, pMD, TypeString::FormatSignature|TypeString::FormatNamespace|TypeString::FormatFullInst); } - PAL_CPP_CATCH_ALL + EX_CATCH { hr = E_FAIL; if (pMD->IsDynamicMethod()) @@ -1292,7 +1292,7 @@ ClrDataAccess::GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, #endif } } - PAL_CPP_ENDTRY + EX_END_CATCH(SwallowAllExceptions) if (SUCCEEDED(hr)) { @@ -1691,7 +1691,7 @@ ClrDataAccess::GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, __out_ { StackSString s; #ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS - PAL_CPP_TRY + EX_TRY { #endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS @@ -1699,14 +1699,14 @@ ClrDataAccess::GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, __out_ #ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS } - PAL_CPP_CATCH_ALL + EX_CATCH { if (!MdCacheGetEEName(dac_cast<TADDR>(pMT), s)) { - PAL_CPP_RETHROW; + EX_RETHROW; } } - PAL_CPP_ENDTRY + EX_END_CATCH(SwallowAllExceptions) #endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS if (s.IsEmpty()) diff --git a/src/debug/daccess/task.cpp b/src/debug/daccess/task.cpp index 1c3c5fd11a..fe60eae04b 100644 --- a/src/debug/daccess/task.cpp +++ b/src/debug/daccess/task.cpp @@ -346,10 +346,12 @@ ClrDataTask::CreateStackWalk( DAC_ENTER_SUB(m_dac); + ClrDataStackWalk* walkClass = NULL; + EX_TRY { - ClrDataStackWalk* walkClass = - new (nothrow) ClrDataStackWalk(m_dac, m_thread, flags); + walkClass = new (nothrow) ClrDataStackWalk(m_dac, m_thread, flags); + if (!walkClass) { status = E_OUTOFMEMORY; @@ -365,6 +367,11 @@ ClrDataTask::CreateStackWalk( } EX_CATCH { + if (walkClass) + { + delete walkClass; + } + if (!DacExceptionFilter(GET_EXCEPTION(), m_dac, &status)) { EX_RETHROW; |