From 7cdde63900a258a26a758f13107766e60e84596a Mon Sep 17 00:00:00 2001 From: Dan Moseley Date: Sun, 27 Oct 2019 12:11:21 -0700 Subject: [PATCH] Remove empty lines caused by empty fusion log string (#27471) * Remove empty lines caused by empty fusion log string * Remove fusion log more --- .../src/System/BadImageFormatException.CoreCLR.cs | 3 +-- .../src/System/IO/FileLoadException.CoreCLR.cs | 3 +-- .../src/System/IO/FileNotFoundException.CoreCLR.cs | 3 +-- src/vm/appdomain.cpp | 2 +- src/vm/clrex.cpp | 10 ++-------- src/vm/clrex.h | 8 +++----- 6 files changed, 9 insertions(+), 20 deletions(-) diff --git a/src/System.Private.CoreLib/src/System/BadImageFormatException.CoreCLR.cs b/src/System.Private.CoreLib/src/System/BadImageFormatException.CoreCLR.cs index a7daa7ff91ea..8f29b3ed60b7 100644 --- a/src/System.Private.CoreLib/src/System/BadImageFormatException.CoreCLR.cs +++ b/src/System.Private.CoreLib/src/System/BadImageFormatException.CoreCLR.cs @@ -7,12 +7,11 @@ namespace System public partial class BadImageFormatException { // Do not delete: this is invoked from native code. - private BadImageFormatException(string? fileName, string? fusionLog, int hResult) + private BadImageFormatException(string? fileName, int hResult) : base(null) { HResult = hResult; _fileName = fileName; - _fusionLog = fusionLog; SetMessageField(); } } diff --git a/src/System.Private.CoreLib/src/System/IO/FileLoadException.CoreCLR.cs b/src/System.Private.CoreLib/src/System/IO/FileLoadException.CoreCLR.cs index 7c4156205911..07259527731c 100644 --- a/src/System.Private.CoreLib/src/System/IO/FileLoadException.CoreCLR.cs +++ b/src/System.Private.CoreLib/src/System/IO/FileLoadException.CoreCLR.cs @@ -10,12 +10,11 @@ namespace System.IO public partial class FileLoadException { // Do not delete: this is invoked from native code. - private FileLoadException(string? fileName, string? fusionLog, int hResult) + private FileLoadException(string? fileName, int hResult) : base(null) { HResult = hResult; FileName = fileName; - FusionLog = fusionLog; _message = FormatFileLoadExceptionMessage(FileName, HResult); } diff --git a/src/System.Private.CoreLib/src/System/IO/FileNotFoundException.CoreCLR.cs b/src/System.Private.CoreLib/src/System/IO/FileNotFoundException.CoreCLR.cs index 8471c9b30143..0a753272df9c 100644 --- a/src/System.Private.CoreLib/src/System/IO/FileNotFoundException.CoreCLR.cs +++ b/src/System.Private.CoreLib/src/System/IO/FileNotFoundException.CoreCLR.cs @@ -7,12 +7,11 @@ namespace System.IO public partial class FileNotFoundException { // Do not delete: this is invoked from native code. - private FileNotFoundException(string? fileName, string? fusionLog, int hResult) + private FileNotFoundException(string? fileName, int hResult) : base(null) { HResult = hResult; FileName = fileName; - FusionLog = fusionLog; SetMessageField(); } } diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp index 7b46b0224127..98853c8311ce 100644 --- a/src/vm/appdomain.cpp +++ b/src/vm/appdomain.cpp @@ -3801,7 +3801,7 @@ DomainAssembly* AppDomain::LoadDomainAssembly(AssemblySpec* pSpec, { StackSString name; pSpec->GetFileOrDisplayName(0, name); - pEx=new EEFileLoadException(name, pEx->GetHR(), NULL, pEx); + pEx=new EEFileLoadException(name, pEx->GetHR(), pEx); AddExceptionToCache(pSpec, pEx); PAL_CPP_THROW(Exception *, pEx); } diff --git a/src/vm/clrex.cpp b/src/vm/clrex.cpp index b0dc916de1a3..b60d56fe5a62 100644 --- a/src/vm/clrex.cpp +++ b/src/vm/clrex.cpp @@ -1675,10 +1675,9 @@ OBJECTREF EETypeLoadException::CreateThrowable() // EEFileLoadException is an EE exception subclass representing a file loading // error // --------------------------------------------------------------------------- -EEFileLoadException::EEFileLoadException(const SString &name, HRESULT hr, void *pFusionLog, Exception *pInnerException/* = NULL*/) +EEFileLoadException::EEFileLoadException(const SString &name, HRESULT hr, Exception *pInnerException/* = NULL*/) : EEException(GetFileLoadKind(hr)), m_name(name), - m_pFusionLog(pFusionLog), m_hr(hr) { CONTRACTL @@ -1822,22 +1821,18 @@ OBJECTREF EEFileLoadException::CreateThrowable() } CONTRACTL_END; - // Fetch any log info from the fusion log - SString logText; struct _gc { OBJECTREF pNewException; STRINGREF pNewFileString; - STRINGREF pFusLogString; } gc; ZeroMemory(&gc, sizeof(gc)); GCPROTECT_BEGIN(gc); gc.pNewFileString = StringObject::NewString(m_name); - gc.pFusLogString = StringObject::NewString(logText); gc.pNewException = AllocateObject(MscorlibBinder::GetException(m_kind)); MethodDesc* pMD = MemberLoader::FindMethod(gc.pNewException->GetMethodTable(), - COR_CTOR_METHOD_NAME, &gsig_IM_Str_Str_Int_RetVoid); + COR_CTOR_METHOD_NAME, &gsig_IM_Str_Int_RetVoid); if (!pMD) { @@ -1850,7 +1845,6 @@ OBJECTREF EEFileLoadException::CreateThrowable() ARG_SLOT args[] = { ObjToArgSlot(gc.pNewException), ObjToArgSlot(gc.pNewFileString), - ObjToArgSlot(gc.pFusLogString), (ARG_SLOT) m_hr }; diff --git a/src/vm/clrex.h b/src/vm/clrex.h index 3fafb05c88ee..8653b4897723 100644 --- a/src/vm/clrex.h +++ b/src/vm/clrex.h @@ -668,13 +668,11 @@ class EEFileLoadException : public EEException private: SString m_name; - void *m_pFusionLog; HRESULT m_hr; - public: - EEFileLoadException(const SString &name, HRESULT hr, void *pFusionLog = NULL, Exception *pInnerException = NULL); + EEFileLoadException(const SString &name, HRESULT hr, Exception *pInnerException = NULL); ~EEFileLoadException(); // virtual overrides @@ -698,12 +696,12 @@ class EEFileLoadException : public EEException virtual Exception *CloneHelper() { WRAPPER_NO_CONTRACT; - return new EEFileLoadException(m_name, m_hr, m_pFusionLog); + return new EEFileLoadException(m_name, m_hr); } private: #ifdef _DEBUG - EEFileLoadException() : m_pFusionLog(NULL) + EEFileLoadException() { // Used only for DebugIsEECxxExceptionPointer to get the vtable pointer. // We need a variant which does not allocate memory.