diff options
Diffstat (limited to 'src/debug/daccess/dacdbiimpl.cpp')
-rw-r--r-- | src/debug/daccess/dacdbiimpl.cpp | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/src/debug/daccess/dacdbiimpl.cpp b/src/debug/daccess/dacdbiimpl.cpp index 598fb2ff2c..07fd438734 100644 --- a/src/debug/daccess/dacdbiimpl.cpp +++ b/src/debug/daccess/dacdbiimpl.cpp @@ -6804,24 +6804,28 @@ bool DacDbiInterfaceImpl::IsValidObject(CORDB_ADDRESS addr) DD_ENTER_MAY_THROW; bool isValid = false; - EX_TRY - { - PTR_Object obj(TO_TADDR(addr)); - - PTR_MethodTable mt = obj->GetMethodTable(); - PTR_EEClass cls = mt->GetClass(); - - if (mt == cls->GetMethodTable()) - isValid = true; - else if (!mt->IsCanonicalMethodTable()) - isValid = cls->GetMethodTable()->GetClass() == cls; - } - EX_CATCH + + if (addr != 0 && addr != (CORDB_ADDRESS)-1) { - isValid = false; + EX_TRY + { + PTR_Object obj(TO_TADDR(addr)); + + PTR_MethodTable mt = obj->GetMethodTable(); + PTR_EEClass cls = mt->GetClass(); + + if (mt == cls->GetMethodTable()) + isValid = true; + else if (!mt->IsCanonicalMethodTable()) + isValid = cls->GetMethodTable()->GetClass() == cls; + } + EX_CATCH + { + isValid = false; + } + EX_END_CATCH(SwallowAllExceptions) } - EX_END_CATCH(SwallowAllExceptions) - + return isValid; } @@ -6830,6 +6834,11 @@ bool DacDbiInterfaceImpl::GetAppDomainForObject(CORDB_ADDRESS addr, OUT VMPTR_Ap { DD_ENTER_MAY_THROW; + if (addr == 0 || addr == (CORDB_ADDRESS)-1) + { + return false; + } + PTR_Object obj(TO_TADDR(addr)); MethodTable *mt = obj->GetMethodTable(); |