Limit RunClassConstructor to ELEMENT_TYPE_CLASS only
authorIgor Kulaychuk <i.kulaychuk@samsung.com>
Fri, 21 Jul 2017 18:16:32 +0000 (21:16 +0300)
committerIgor Kulaychuk <i.kulaychuk@samsung.com>
Mon, 13 Nov 2017 19:22:40 +0000 (22:22 +0300)
src/debug/netcoredbg/varobj.cpp

index 7430d84..70a2417 100644 (file)
@@ -192,6 +192,13 @@ static HRESULT RunClassConstructor(ICorDebugThread *pThread, ICorDebugILFrame *p
     ToRelease<ICorDebugValue> pUnboxedValue;
     BOOL isNull = FALSE;
     IfFailRet(DereferenceAndUnboxValue(pValue, &pUnboxedValue, &isNull));
+
+    CorElementType et;
+    IfFailRet(pUnboxedValue->GetType(&et));
+
+    if (et != ELEMENT_TYPE_CLASS)
+        return S_OK;
+
     if (isNull)
     {
         ToRelease<ICorDebugValue2> pValue2;