From: Igor Kulaychuk Date: Wed, 13 Jun 2018 18:01:59 +0000 (+0300) Subject: Check return value of GetMethodProps() method X-Git-Tag: submit/tizen/20180620.071641^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3ed4c76bdc520e29f7762ec592d063979ef9811a;p=sdk%2Ftools%2Fnetcoredbg.git Check return value of GetMethodProps() method --- diff --git a/src/debug/netcoredbg/jmc.cpp b/src/debug/netcoredbg/jmc.cpp index 1e19024..7d526df 100644 --- a/src/debug/netcoredbg/jmc.cpp +++ b/src/debug/netcoredbg/jmc.cpp @@ -144,6 +144,9 @@ static HRESULT GetNonJMCMethodsForTypeDef( szFunctionName, _countof(szFunctionName), &nameLen, nullptr, nullptr, nullptr, nullptr, nullptr); + if (FAILED(Status)) + continue; + if ((g_operatorMethodNames.find(to_utf8(szFunctionName)) != g_operatorMethodNames.end()) || HasAttribute(pMD, methodDef, g_nonUserCode) || HasAttribute(pMD, methodDef, g_stepThrough) diff --git a/src/debug/netcoredbg/typeprinter.cpp b/src/debug/netcoredbg/typeprinter.cpp index 7fc92be..6882c8b 100644 --- a/src/debug/netcoredbg/typeprinter.cpp +++ b/src/debug/netcoredbg/typeprinter.cpp @@ -771,9 +771,9 @@ HRESULT TypePrinter::GetTypeAndMethod(ICorDebugFrame *pFrame, std::string &typeN ToRelease pMD2; IfFailRet(pMDUnknown->QueryInterface(IID_IMetaDataImport2, (LPVOID*) &pMD2)); - hr = pMD->GetMethodProps(methodDef, &memTypeDef, - szFunctionName, _countof(szFunctionName), &nameLen, - &flags, &pbSigBlob, &ulSigBlob, &ulCodeRVA, &ulImplFlags); + IfFailRet(pMD->GetMethodProps(methodDef, &memTypeDef, + szFunctionName, _countof(szFunctionName), &nameLen, + &flags, &pbSigBlob, &ulSigBlob, &ulCodeRVA, &ulImplFlags)); std::string funcName = to_utf8(szFunctionName/*, nameLen*/);