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
#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()) ||