From 4e332945b6e697fccbbbec3fb163c5161253e79c Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Sat, 10 Mar 2018 18:29:42 -0800 Subject: [PATCH] Set IsGeneratingNgenPDB flag early (#16882) Fixes #16864 --- src/vm/compile.cpp | 1 - src/vm/compile.h | 5 +++++ src/zap/zapper.cpp | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/vm/compile.cpp b/src/vm/compile.cpp index 904dd99..28283b6 100644 --- a/src/vm/compile.cpp +++ b/src/vm/compile.cpp @@ -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"); diff --git a/src/vm/compile.h b/src/vm/compile.h index bdcff9f..5be78c2 100644 --- a/src/vm/compile.h +++ b/src/vm/compile.h @@ -180,6 +180,11 @@ typedef SHash ZapperLoaderModuleTable; class CEECompileInfo : public ICorCompileInfo { public: + CEECompileInfo() + : m_fGeneratingNgenPDB(FALSE) + { + } + virtual ~CEECompileInfo() { WRAPPER_NO_CONTRACT; diff --git a/src/zap/zapper.cpp b/src/zap/zapper.cpp index 52f2ce4..59d05a0 100644 --- a/src/zap/zapper.cpp +++ b/src/zap/zapper.cpp @@ -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, -- 2.7.4