Allow cross machine re-crossgen (#14241)
authorSteve MacLean <sdmaclea.qdt@qualcommdatacenter.com>
Fri, 29 Sep 2017 12:10:32 +0000 (08:10 -0400)
committerJan Kotas <jkotas@microsoft.com>
Fri, 29 Sep 2017 12:10:32 +0000 (05:10 -0700)
src/vm/readytoruninfo.cpp

index 996a862..5ac1eb1 100644 (file)
@@ -495,12 +495,6 @@ PTR_ReadyToRunInfo ReadyToRunInfo::Initialize(Module * pModule, AllocMemTracker
         return NULL;
     }
 
-    if (!pLayout->IsNativeMachineFormat())
-    {
-        // For CoreCLR, be strict about disallowing machine mismatches.
-        COMPlusThrowHR(COR_E_BADIMAGEFORMAT);
-    }
-
 #ifdef FEATURE_NATIVE_IMAGE_GENERATION
     // Ignore ReadyToRun during NGen
     if (IsCompilationProcess() && !IsNgenPDBCompilationProcess())
@@ -510,6 +504,12 @@ PTR_ReadyToRunInfo ReadyToRunInfo::Initialize(Module * pModule, AllocMemTracker
     }
 #endif
 
+    if (!pLayout->IsNativeMachineFormat())
+    {
+        // For CoreCLR, be strict about disallowing machine mismatches.
+        COMPlusThrowHR(COR_E_BADIMAGEFORMAT);
+    }
+
 #ifndef CROSSGEN_COMPILE
     // The file must have been loaded using LoadLibrary
     if (!pLayout->IsRelocated())