summaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorAndrew Au <andrewau@microsoft.com>2018-08-10 10:27:24 -0700
committerAndrew Au <cshung@gmail.com>2018-11-06 18:34:47 -0800
commit3c2a1f099cf2150f5b3597bd3d40e1061ef13aa7 (patch)
treeac9cd9ec4cf372fc38404e570d66c68e1e64c644 /src/debug
parent0e3a4d9c419b41ddbbccc22b5d668442f2cbfd76 (diff)
downloadcoreclr-3c2a1f099cf2150f5b3597bd3d40e1061ef13aa7.tar.gz
coreclr-3c2a1f099cf2150f5b3597bd3d40e1061ef13aa7.tar.bz2
coreclr-3c2a1f099cf2150f5b3597bd3d40e1061ef13aa7.zip
Fix a couple bugs in GetContainingObject
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/di/process.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/debug/di/process.cpp b/src/debug/di/process.cpp
index 1411857636..522520526e 100644
--- a/src/debug/di/process.cpp
+++ b/src/debug/di/process.cpp
@@ -2529,10 +2529,15 @@ COM_METHOD CordbProcess::EnableExceptionCallbacksOutsideOfMyCode(BOOL enableExce
COM_METHOD CordbProcess::GetContainingObject(CORDB_ADDRESS interiorPointer, ICorDebugObjectValue** ppContainingObject)
{
+ if (!ppContainingObject)
+ return E_POINTER;
+
HRESULT hr = S_OK;
// TODO, databp, I don't know what I am doing, NO_LOCK doesn't sound right
PUBLIC_API_NO_LOCK_BEGIN(this);
+ *ppContainingObject = nullptr;
+
RSLockHolder ch(this->GetStopGoLock());
DebuggerIPCEvent event;
@@ -2543,14 +2548,21 @@ COM_METHOD CordbProcess::GetContainingObject(CORDB_ADDRESS interiorPointer, ICor
event.GetContainer.interiorPointer = CORDB_ADDRESS_TO_PTR(interiorPointer);
- HRESULT hr = this->SendIPCEvent(&event, sizeof(DebuggerIPCEvent));
+ hr = this->SendIPCEvent(&event, sizeof(DebuggerIPCEvent));
hr = WORST_HR(hr, event.hr);
if (SUCCEEDED(hr))
{
_ASSERTE(event.type == DB_IPCE_GET_CONTAINER_RESULT);
CORDB_ADDRESS containerAddress = PTR_TO_CORDB_ADDRESS(event.GetContainerResult.answer);
- hr = this->GetObject(containerAddress, ppContainingObject);
+ if (containerAddress == 0)
+ {
+ hr = S_FALSE;
+ }
+ else
+ {
+ hr = this->GetObject(containerAddress, ppContainingObject);
+ }
}
PUBLIC_API_END(hr);