From ddceccab1a5f350fd9b413ed97890126e55c4966 Mon Sep 17 00:00:00 2001 From: Igor Kulaychuk Date: Mon, 10 Jul 2017 17:02:34 +0300 Subject: [PATCH] Fix checking static flag of a property --- src/debug/debugger/varobj.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/debug/debugger/varobj.cpp b/src/debug/debugger/varobj.cpp index 241237d..db7563c 100644 --- a/src/debug/debugger/varobj.cpp +++ b/src/debug/debugger/varobj.cpp @@ -410,7 +410,11 @@ static HRESULT GetNumChild(ICorDebugValue *pInputValue, 0, NULL))) { - if (propFlags & fdStatic) + DWORD getterAttr = 0; + if (FAILED(pMD->GetMethodProps(mdGetter, NULL, NULL, 0, NULL, &getterAttr, NULL, NULL, NULL, NULL))) + continue; + + if (getterAttr & mdStatic) { if (numstaticBack == 0) numstatic++; @@ -716,13 +720,17 @@ static HRESULT PrintFieldsAndProperties(ICorDebugValue *pInputValue, 1, &cOtherMethod))) { + DWORD getterAttr = 0; + if (FAILED(pMD->GetMethodProps(mdGetter, NULL, NULL, 0, NULL, &getterAttr, NULL, NULL, NULL, NULL))) + continue; + char cName[mdNameLen] = {0}; WideCharToMultiByte(CP_UTF8, 0, propertyName, (int)(propertyNameLen + 1), cName, _countof(cName), NULL, NULL); if (backedProperies.find(cName) != backedProperies.end()) continue; - bool is_static = (propFlags & fdStatic); + bool is_static = (getterAttr & mdStatic); if (is_static) has_static_members = true; -- 2.7.4