Fix a crash in WriteMethodProfileDataLogFile (#50473)
authorDong-Heon Jung <dheon.jung@samsung.com>
Wed, 31 Mar 2021 15:42:59 +0000 (00:42 +0900)
committerGitHub <noreply@github.com>
Wed, 31 Mar 2021 15:42:59 +0000 (08:42 -0700)
pEmitter is not assigned in https://github.com/dotnet/runtime/pull/50242

src/coreclr/vm/ceeload.cpp

index 12c12f4..f84714c 100644 (file)
@@ -11855,7 +11855,7 @@ HRESULT Module::WriteMethodProfileDataLogFile(bool cleanup)
     {
         if (GetAssembly()->IsInstrumented() && (m_pProfilingBlobTable != NULL) && (m_tokenProfileData != NULL))
         {
-            NewHolder<ProfileEmitter> pEmitter;
+            NewHolder<ProfileEmitter> pEmitter(new ProfileEmitter());
 
             // Get this ahead of time - metadata access may be logged, which will
             // take the m_tokenProfileData->crst, which we take a couple lines below