Set IsGeneratingNgenPDB flag early (#16882)
authorJan Kotas <jkotas@microsoft.com>
Sun, 11 Mar 2018 02:29:42 +0000 (18:29 -0800)
committerGitHub <noreply@github.com>
Sun, 11 Mar 2018 02:29:42 +0000 (18:29 -0800)
Fixes #16864

src/vm/compile.cpp
src/vm/compile.h
src/zap/zapper.cpp

index 904dd99..28283b6 100644 (file)
@@ -90,7 +90,6 @@ HRESULT CEECompileInfo::Startup(  BOOL fForceDebug,
     HRESULT hr = S_OK;
 
     m_fCachingOfInliningHintsEnabled = TRUE;
-    m_fGeneratingNgenPDB = FALSE;
 
     _ASSERTE(!g_fEEStarted && !g_fEEInit && "You cannot run the EE inside an NGEN compilation process");
 
index bdcff9f..5be78c2 100644 (file)
@@ -180,6 +180,11 @@ typedef  SHash<ZapperLoaderModuleTableTraits> ZapperLoaderModuleTable;
 class CEECompileInfo : public ICorCompileInfo
 {
   public:
+    CEECompileInfo()
+       : m_fGeneratingNgenPDB(FALSE)
+    {
+    }
+
     virtual ~CEECompileInfo()
     {
         WRAPPER_NO_CONTRACT;
index 52f2ce4..59d05a0 100644 (file)
@@ -167,6 +167,8 @@ STDAPI CreatePDBWorker(LPCWSTR pwzAssemblyPath, LPCWSTR pwzPlatformAssembliesPat
 
     EX_TRY
     {
+        GetCompileInfo()->SetIsGeneratingNgenPDB(TRUE);
+
         NGenOptions ngo = {0};
         ngo.dwSize = sizeof(NGenOptions);
 
@@ -1061,8 +1063,6 @@ void Zapper::CreatePdbInCurrentDomain(BSTR pAssemblyPathOrName, BSTR pNativeImag
     {
         CORINFO_ASSEMBLY_HANDLE hAssembly = NULL;
 
-        m_pEECompileInfo->SetIsGeneratingNgenPDB(TRUE);
-
         IfFailThrow(m_pEECompileInfo->LoadAssemblyByPath(
             pAssemblyPathOrName,