summaryrefslogtreecommitdiff
path: root/src/vm
diff options
context:
space:
mode:
authorMukul Sabharwal <mjsabby@gmail.com>2019-05-06 08:21:19 -0700
committerJan Kotas <jkotas@microsoft.com>2019-05-06 08:21:19 -0700
commit7681c19e4a6f2b5a82abf6268e96eb9140f08bb7 (patch)
tree96205a68f11638438cb20b103fbb03623fc8ff96 /src/vm
parentde48d04cc8091ed108fd643dc4eeb33e0afd0bcd (diff)
downloadcoreclr-7681c19e4a6f2b5a82abf6268e96eb9140f08bb7.tar.gz
coreclr-7681c19e4a6f2b5a82abf6268e96eb9140f08bb7.tar.bz2
coreclr-7681c19e4a6f2b5a82abf6268e96eb9140f08bb7.zip
Fixes AV when accessing LoaderModule for some objects (#24406)
Diffstat (limited to 'src/vm')
-rw-r--r--src/vm/object.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vm/object.cpp b/src/vm/object.cpp
index a1453432b2..f0de65b01f 100644
--- a/src/vm/object.cpp
+++ b/src/vm/object.cpp
@@ -173,6 +173,11 @@ TypeHandle Object::GetGCSafeTypeHandleIfPossible() const
MethodTable * pMT = GetGCSafeMethodTable();
_ASSERTE(pMT != NULL);
+ if (pMT == g_pFreeObjectMethodTable)
+ {
+ return NULL;
+ }
+
// Don't look at types that belong to an unloading AppDomain, or else
// pObj->GetGCSafeTypeHandle() can AV. For example, we encountered this AV when pObj
// was an array like this:
@@ -223,8 +228,6 @@ TypeHandle Object::GetGCSafeTypeHandleIfPossible() const
Module * pLoaderModule = pMTToCheck->GetLoaderModule();
- BaseDomain * pBaseDomain = pLoaderModule->GetDomain();
-
// Don't look up types that are unloading due to Collectible Assemblies. Haven't been
// able to find a case where we actually encounter objects like this that can cause
// problems; however, it seems prudent to add this protection just in case.