From 7c7f1a00075a3206304000ae042fb00cdaeb5904 Mon Sep 17 00:00:00 2001 From: Igor Kulaychuk Date: Fri, 21 Jul 2017 21:16:32 +0300 Subject: [PATCH] Limit RunClassConstructor to ELEMENT_TYPE_CLASS only --- src/debug/netcoredbg/varobj.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/debug/netcoredbg/varobj.cpp b/src/debug/netcoredbg/varobj.cpp index 7430d84..70a2417 100644 --- a/src/debug/netcoredbg/varobj.cpp +++ b/src/debug/netcoredbg/varobj.cpp @@ -192,6 +192,13 @@ static HRESULT RunClassConstructor(ICorDebugThread *pThread, ICorDebugILFrame *p ToRelease 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 pValue2; -- 2.7.4