Skip to content

Commit b7dd183

Browse files
authored
Remove some dead code that threw file load exception (#87290)
* Remove some dead code that threw file load exception * Remove FUSION_E_CACHEFILE_FAILED
1 parent d88f9a0 commit b7dd183

File tree

15 files changed

+8
-69
lines changed

15 files changed

+8
-69
lines changed

src/coreclr/dlls/mscorrc/mscorrc.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ BEGIN
115115
FUSION_E_REF_DEF_MISMATCH "The located assembly's manifest definition with name '%1' does not match the assembly reference."
116116
FUSION_E_PRIVATE_ASM_DISALLOWED "Assembly '%1' is required to be strongly named."
117117
FUSION_E_INVALID_NAME "The given assembly name, '%1', was invalid."
118-
FUSION_E_CACHEFILE_FAILED "Failed to add file to AppDomain cache."
119118
FUSION_E_APP_DOMAIN_LOCKED "The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest."
120119
IDS_EE_HASH_VAL_FAILED "Hash validation failed for file or assembly '%1'."
121120
CORSEC_E_INVALID_PUBLICKEY "The public key for assembly '%1' was invalid."

src/coreclr/inc/corerror.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,6 @@
184184
<Comment> The given assembly name was invalid. </Comment>
185185
</HRESULT>
186186

187-
<HRESULT NumericValue="0x80131052">
188-
<SymbolicName>FUSION_E_CACHEFILE_FAILED</SymbolicName>
189-
<Message>"Failed to add file to AppDomain cache."</Message>
190-
<Comment> Failed to add file to AppDomain cache </Comment>
191-
</HRESULT>
192-
193187
<HRESULT NumericValue="0x80131053">
194188
<SymbolicName>FUSION_E_APP_DOMAIN_LOCKED</SymbolicName>
195189
<Message>"The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest."</Message>

src/coreclr/pal/prebuilt/corerror/mscorurt.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ BEGIN
1616
MSG_FOR_URT_HR(FUSION_E_REF_DEF_MISMATCH) "The located assembly's manifest definition does not match the assembly reference."
1717
MSG_FOR_URT_HR(FUSION_E_PRIVATE_ASM_DISALLOWED) "A strongly-named assembly is required."
1818
MSG_FOR_URT_HR(FUSION_E_INVALID_NAME) "The given assembly name was invalid."
19-
MSG_FOR_URT_HR(FUSION_E_CACHEFILE_FAILED) "Failed to add file to AppDomain cache."
2019
MSG_FOR_URT_HR(FUSION_E_APP_DOMAIN_LOCKED) "The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest."
2120
MSG_FOR_URT_HR(COR_E_LOADING_REFERENCE_ASSEMBLY) "Reference assemblies cannot be loaded for execution."
2221
MSG_FOR_URT_HR(COR_E_AMBIGUOUSIMPLEMENTATION) "Ambiguous implementation found."

src/coreclr/pal/prebuilt/inc/corerror.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#define FUSION_E_REF_DEF_MISMATCH EMAKEHR(0x1040)
4444
#define FUSION_E_PRIVATE_ASM_DISALLOWED EMAKEHR(0x1044)
4545
#define FUSION_E_INVALID_NAME EMAKEHR(0x1047)
46-
#define FUSION_E_CACHEFILE_FAILED EMAKEHR(0x1052)
4746
#define FUSION_E_APP_DOMAIN_LOCKED EMAKEHR(0x1053)
4847
#define COR_E_LOADING_REFERENCE_ASSEMBLY EMAKEHR(0x1058)
4948
#define COR_E_AMBIGUOUSIMPLEMENTATION EMAKEHR(0x106a)

src/coreclr/utilcode/ex.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,6 @@ LPCSTR Exception::GetHRSymbolicName(HRESULT hr)
573573
CASE_HRESULT(COR_E_APPDOMAINUNLOADED)
574574
CASE_HRESULT(COR_E_CANNOTUNLOADAPPDOMAIN)
575575
CASE_HRESULT(MSEE_E_ASSEMBLYLOADINPROGRESS)
576-
CASE_HRESULT(FUSION_E_CACHEFILE_FAILED)
577576
CASE_HRESULT(FUSION_E_REF_DEF_MISMATCH)
578577
CASE_HRESULT(FUSION_E_PRIVATE_ASM_DISALLOWED)
579578
CASE_HRESULT(FUSION_E_INVALID_NAME)

src/coreclr/vm/appdomain.cpp

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3262,7 +3262,7 @@ PVOID AppDomain::GetFriendlyNameNoSet(bool* isUtf8)
32623262

32633263
#ifndef DACCESS_COMPILE
32643264

3265-
BOOL AppDomain::AddFileToCache(AssemblySpec* pSpec, PEAssembly * pPEAssembly, BOOL fAllowFailure)
3265+
BOOL AppDomain::AddFileToCache(AssemblySpec* pSpec, PEAssembly * pPEAssembly)
32663266
{
32673267
CONTRACTL
32683268
{
@@ -3274,25 +3274,10 @@ BOOL AppDomain::AddFileToCache(AssemblySpec* pSpec, PEAssembly * pPEAssembly, BO
32743274
}
32753275
CONTRACTL_END;
32763276

3277-
{
3278-
GCX_PREEMP();
3279-
DomainCacheCrstHolderForGCCoop holder(this);
3280-
3281-
// !!! suppress exceptions
3282-
if(!m_AssemblyCache.StorePEAssembly(pSpec, pPEAssembly) && !fAllowFailure)
3283-
{
3284-
// TODO: Disabling the below assertion as currently we experience
3285-
// inconsistency on resolving the Microsoft.Office.Interop.MSProject.dll
3286-
// This causes below assertion to fire and crashes the VS. This issue
3287-
// is being tracked with Dev10 Bug 658555. Brought back it when this bug
3288-
// is fixed.
3289-
// _ASSERTE(FALSE);
3290-
3291-
EEFileLoadException::Throw(pSpec, FUSION_E_CACHEFILE_FAILED, NULL);
3292-
}
3293-
}
3277+
GCX_PREEMP();
3278+
DomainCacheCrstHolderForGCCoop holder(this);
32943279

3295-
return TRUE;
3280+
return m_AssemblyCache.StorePEAssembly(pSpec, pPEAssembly);
32963281
}
32973282

32983283
BOOL AppDomain::AddAssemblyToCache(AssemblySpec* pSpec, DomainAssembly *pAssembly)
@@ -3505,10 +3490,10 @@ BOOL AppDomain::PostBindResolveAssembly(AssemblySpec *pPrePolicySpec,
35053490
// The binder does a re-fetch of the
35063491
// original binding spec and therefore will not cause inconsistency here.
35073492
// For the purposes of the resolve event, failure to add to the cache still is a success.
3508-
AddFileToCache(pPrePolicySpec, result, TRUE /* fAllowFailure */);
3493+
AddFileToCache(pPrePolicySpec, result);
35093494
if (*ppFailedSpec != pPrePolicySpec)
35103495
{
3511-
AddFileToCache(pPostPolicySpec, result, TRUE /* fAllowFailure */ );
3496+
AddFileToCache(pPostPolicySpec, result);
35123497
}
35133498
}
35143499
}
@@ -3569,7 +3554,7 @@ PEAssembly * AppDomain::BindAssemblySpec(
35693554
// Failure to add simply means someone else beat us to it. In that case
35703555
// the FindCachedFile call below (after catch block) will update result
35713556
// to the cached value.
3572-
AddFileToCache(pSpec, result, TRUE /*fAllowFailure*/);
3557+
AddFileToCache(pSpec, result);
35733558
}
35743559
else
35753560
{

src/coreclr/vm/appdomain.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1869,7 +1869,7 @@ class AppDomain : public BaseDomain
18691869
BOOL IsCached(AssemblySpec *pSpec);
18701870
#endif // DACCESS_COMPILE
18711871

1872-
BOOL AddFileToCache(AssemblySpec* pSpec, PEAssembly *pPEAssembly, BOOL fAllowFailure = FALSE);
1872+
BOOL AddFileToCache(AssemblySpec* pSpec, PEAssembly *pPEAssembly);
18731873
BOOL RemoveFileFromCache(PEAssembly *pPEAssembly);
18741874

18751875
BOOL AddAssemblyToCache(AssemblySpec* pSpec, DomainAssembly *pAssembly);

src/coreclr/vm/coreassemblyspec.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,6 @@
2828
#include "../binder/inc/assemblybindercommon.hpp"
2929
#include "../binder/inc/applicationcontext.hpp"
3030

31-
static VOID ThrowLoadError(AssemblySpec * pSpec, HRESULT hr)
32-
{
33-
CONTRACTL
34-
{
35-
THROWS;
36-
MODE_ANY;
37-
GC_TRIGGERS;
38-
}
39-
CONTRACTL_END;
40-
41-
StackSString name;
42-
pSpec->GetDisplayName(0, name);
43-
EEFileLoadException::Throw(name, hr);
44-
}
45-
4631
HRESULT AssemblySpec::Bind(AppDomain *pAppDomain, BINDER_SPACE::Assembly** ppAssembly)
4732
{
4833
CONTRACTL

src/coreclr/vm/peimage.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -387,20 +387,6 @@ void PEImage::GetMVID(GUID *pMvid)
387387
#endif // _DEBUG
388388
}
389389

390-
void DECLSPEC_NORETURN PEImage::ThrowFormat(HRESULT hrError)
391-
{
392-
CONTRACTL
393-
{
394-
GC_TRIGGERS;
395-
THROWS;
396-
MODE_ANY;
397-
}
398-
CONTRACTL_END;
399-
400-
EEFileLoadException::Throw(m_path, hrError);
401-
}
402-
403-
404390
//may outlive PEImage
405391
PEImage::IJWFixupData::IJWFixupData(void *pBase)
406392
: m_lock(CrstIJWFixupData),

src/coreclr/vm/peimage.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ class PEImage final
232232
static BOOL CompareImage(UPTR image1, UPTR image2);
233233
static BOOL CompareIJWDataBase(UPTR base, UPTR mapping);
234234

235-
void DECLSPEC_NORETURN ThrowFormat(HRESULT hr);
236-
237235
public:
238236
class IJWFixupData
239237
{

0 commit comments

Comments
 (0)