Skip type sanity checks for CoreLib (dotnet/coreclr#24074)
authorJan Kotas <jkotas@microsoft.com>
Thu, 18 Apr 2019 14:13:33 +0000 (07:13 -0700)
committerGitHub <noreply@github.com>
Thu, 18 Apr 2019 14:13:33 +0000 (07:13 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/3188635a14e9c60acdd220add720ebb86e3b9862

src/coreclr/src/vm/methodtable.cpp
src/coreclr/src/vm/methodtablebuilder.cpp

index 43ba55b..fed3f98 100644 (file)
@@ -5661,7 +5661,7 @@ void MethodTable::DoFullyLoad(Generics::RecursionGraph * const pVisited,  const
         Module * pModule = GetModule();
 
         // No sanity checks for ready-to-run compiled images if possible
-        if (pModule->IsReadyToRun() && pModule->GetReadyToRunInfo()->SkipTypeValidation())
+        if (pModule->IsSystem() || (pModule->IsReadyToRun() && pModule->GetReadyToRunInfo()->SkipTypeValidation()))
             fNeedsSanityChecks = false;
     }
 #endif
index 286cd74..b64d75e 100644 (file)
@@ -1390,7 +1390,7 @@ MethodTableBuilder::BuildMethodTableThrowing(
 #endif // _DEBUG
 
     // If this is mscorlib, then don't perform some sanity checks on the layout
-    bmtProp->fNoSanityChecks = ((g_pObjectClass == NULL) || pModule == g_pObjectClass->GetModule()) ||
+    bmtProp->fNoSanityChecks = pModule->IsSystem() ||
 #ifdef FEATURE_READYTORUN
         // No sanity checks for ready-to-run compiled images if possible
         (pModule->IsReadyToRun() && pModule->GetReadyToRunInfo()->SkipTypeValidation()) ||