From 54e7aa60051b0fe5d251e46bf3fdf57bc717a0fc Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Fri, 7 Aug 2026 11:29:54 -0700 Subject: [PATCH 1/6] Remove redundant PEAssembly constructor parameters The PEAssembly constructor took both a bind result and a separate PEImage/host assembly pair. The latter two existed only to serve the Open(PEImage*, BINDER_SPACE::Assembly*) overload, whose single caller passed pAssembly->GetPEImage() and pAssembly. Since the constructor derived the image from the bind result and stored either assembly into m_pHostAssembly, that call was already equivalent to Open(pAssembly). Drop the two parameters along with the overload and the asserts that only policed their mutual exclusion, and switch the caller over. Also rename pBindResultInfo to pBoundAssembly to match the terminology already used at the call sites. No functional change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c402dd9b-2e2c-4ee9-a925-019776c1a9cc --- src/coreclr/vm/assemblynative.cpp | 2 +- src/coreclr/vm/peassembly.cpp | 49 +++++-------------------------- src/coreclr/vm/peassembly.h | 12 ++------ 3 files changed, 12 insertions(+), 51 deletions(-) diff --git a/src/coreclr/vm/assemblynative.cpp b/src/coreclr/vm/assemblynative.cpp index 032be96715869d..683c26aaed3445 100644 --- a/src/coreclr/vm/assemblynative.cpp +++ b/src/coreclr/vm/assemblynative.cpp @@ -181,7 +181,7 @@ Assembly* AssemblyNative::LoadFromPEImage(AssemblyBinder* pBinder, PEImage *pIma } } - PEAssemblyHolder pPEAssembly(PEAssembly::Open(pAssembly->GetPEImage(), pAssembly)); + PEAssemblyHolder pPEAssembly(PEAssembly::Open(pAssembly)); bindOperation.SetResult(pPEAssembly); return pCurDomain->LoadAssembly(&spec, pPEAssembly, FILE_LOADED); diff --git a/src/coreclr/vm/peassembly.cpp b/src/coreclr/vm/peassembly.cpp index 1e9b7c4d24718a..89021f76284100 100644 --- a/src/coreclr/vm/peassembly.cpp +++ b/src/coreclr/vm/peassembly.cpp @@ -639,17 +639,14 @@ ULONG PEAssembly::GetPEImageTimeDateStamp() #ifndef DACCESS_COMPILE PEAssembly::PEAssembly( - BINDER_SPACE::Assembly* pBindResultInfo, + BINDER_SPACE::Assembly* pBoundAssembly, IMetaDataEmit* pEmit, BOOL isSystem, - AssemblyBinder* pDynamicAssemblyBinder /*= NULL*/, - PEImage * pPEImage /*= NULL*/, - BINDER_SPACE::Assembly * pHostAssembly /*= NULL*/) + AssemblyBinder* pDynamicAssemblyBinder /*= NULL*/) { CONTRACTL { PRECONDITION(CheckPointer(pEmit, NULL_OK)); - PRECONDITION(pBindResultInfo == NULL || pPEImage == NULL); STANDARD_VM_CHECK; } CONTRACTL_END; @@ -667,8 +664,8 @@ PEAssembly::PEAssembly( m_pHostAssembly = nullptr; m_pAssemblyBinder = nullptr; - pPEImage = pBindResultInfo ? pBindResultInfo->GetPEImage() : pPEImage; - if (pPEImage) + PEImage* pPEImage = pBoundAssembly ? pBoundAssembly->GetPEImage() : NULL; + if (pPEImage != NULL) { _ASSERTE(pPEImage->CheckUniqueInstance()); pPEImage->AddRef(); @@ -704,21 +701,9 @@ PEAssembly::PEAssembly( // Set the host assembly and binding context as the AssemblySpec initialization // for CoreCLR will expect to have it set. - if (pHostAssembly != nullptr) - { - m_pHostAssembly = clr::SafeAddRef(pHostAssembly); - } - - if(pBindResultInfo != nullptr) - { - // Cannot have both pHostAssembly and a coreclr based bind - _ASSERTE(pHostAssembly == nullptr); - pBindResultInfo = clr::SafeAddRef(pBindResultInfo); - m_pHostAssembly = pBindResultInfo; - } - - if (m_pHostAssembly != nullptr) + if (pBoundAssembly != nullptr) { + m_pHostAssembly = clr::SafeAddRef(pBoundAssembly); m_pAssemblyBinder = m_pHostAssembly->GetBinder(); } else @@ -734,24 +719,6 @@ PEAssembly::PEAssembly( #endif // !DACCESS_COMPILE -PEAssembly *PEAssembly::Open( - PEImage * pPEImageIL, - BINDER_SPACE::Assembly * pHostAssembly) -{ - STANDARD_VM_CONTRACT; - - PEAssembly * pPEAssembly = new PEAssembly( - nullptr, // BindResult - nullptr, // IMetaDataEmit - FALSE, // isSystem - nullptr, // DynamicAssemblyBinder - pPEImageIL, - pHostAssembly); - - return pPEAssembly; -} - - PEAssembly::~PEAssembly() { CONTRACTL @@ -831,9 +798,9 @@ PEAssembly *PEAssembly::DoOpenSystem() return new PEAssembly(pBoundAssembly, NULL, TRUE); } -PEAssembly* PEAssembly::Open(BINDER_SPACE::Assembly* pBindResult) +PEAssembly* PEAssembly::Open(BINDER_SPACE::Assembly* pBoundAssembly) { - return new PEAssembly(pBindResult,NULL,/*isSystem*/ false); + return new PEAssembly(pBoundAssembly, NULL, /*isSystem*/ false); }; /* static */ diff --git a/src/coreclr/vm/peassembly.h b/src/coreclr/vm/peassembly.h index 0d83a80c24ae0f..1b35c6df28f644 100644 --- a/src/coreclr/vm/peassembly.h +++ b/src/coreclr/vm/peassembly.h @@ -321,14 +321,10 @@ class PEAssembly final // Creation entry points // ------------------------------------------------------------ - static PEAssembly* Open( - PEImage* pPEImageIL, - BINDER_SPACE::Assembly* pHostAssembly); - // This opens the canonical System.Private.CoreLib.dll static PEAssembly* OpenSystem(); - static PEAssembly* Open(BINDER_SPACE::Assembly* pBindResult); + static PEAssembly* Open(BINDER_SPACE::Assembly* pBoundAssembly); static PEAssembly* Create(IMetaDataAssemblyEmit* pEmit, AssemblyBinder* pDynamicAssemblyBinder); @@ -356,12 +352,10 @@ class PEAssembly final PEAssembly() = default; #else PEAssembly( - BINDER_SPACE::Assembly* pBindResultInfo, + BINDER_SPACE::Assembly* pBoundAssembly, IMetaDataEmit* pEmit, BOOL isSystem, - AssemblyBinder* pDynamicAssemblyBinder = NULL, - PEImage* pPEImageIL = NULL, - BINDER_SPACE::Assembly* pHostAssembly = NULL + AssemblyBinder* pDynamicAssemblyBinder = NULL ); ~PEAssembly(); From ab136e518a8dfc0bfa50a4cedcdecce18dcafe95 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Fri, 7 Aug 2026 19:25:52 -0700 Subject: [PATCH 2/6] Clarify the two kinds of PEAssembly in its constructor A PEAssembly is either bound by an AssemblyBinder or dynamic (reflection emit), but nothing said so. Replace the constructor's lone NULL_OK check on pEmit with preconditions stating that exactly one of pBoundAssembly and pEmit is supplied, that only a bound assembly can be CoreLib, and that a bound assembly takes its binder from the bind result rather than from a caller. Move the field initialization to a member initializer list so nothing is left unset before the body runs, and switch isSystem and IsSystem to bool to match the m_isSystem field, dropping the implicit BOOL narrowing. The Assembly and Module IsSystem forwarders change with it so the whole chain agrees. No functional change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: c402dd9b-2e2c-4ee9-a925-019776c1a9cc --- src/coreclr/vm/assembly.hpp | 2 +- src/coreclr/vm/ceeload.h | 2 +- src/coreclr/vm/peassembly.cpp | 39 ++++++++++++++++++++--------------- src/coreclr/vm/peassembly.h | 8 +++---- src/coreclr/vm/peassembly.inl | 2 +- 5 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/coreclr/vm/assembly.hpp b/src/coreclr/vm/assembly.hpp index 15f4617cc5dce7..47f35654203e85 100644 --- a/src/coreclr/vm/assembly.hpp +++ b/src/coreclr/vm/assembly.hpp @@ -164,7 +164,7 @@ class Assembly static Assembly *Create(PEAssembly *pPEAssembly, AllocMemTracker *pamTracker, LoaderAllocator *pLoaderAllocator); static void Initialize(); - BOOL IsSystem() { WRAPPER_NO_CONTRACT; return m_pPEAssembly->IsSystem(); } + bool IsSystem() { WRAPPER_NO_CONTRACT; return m_pPEAssembly->IsSystem(); } static Assembly* CreateDynamic(AssemblyBinder* pBinder, NativeAssemblyNameParts* pAssemblyNameParts, INT32 hashAlgorithm, INT32 access, LOADERALLOCATORREF* pKeepAlive); diff --git a/src/coreclr/vm/ceeload.h b/src/coreclr/vm/ceeload.h index 8f0d190464fa87..2fcdaaa16c39e1 100644 --- a/src/coreclr/vm/ceeload.h +++ b/src/coreclr/vm/ceeload.h @@ -923,7 +923,7 @@ class Module : public ModuleBase #endif BOOL IsReflectionEmit() const { WRAPPER_NO_CONTRACT; SUPPORTS_DAC; return (m_dwTransientFlags & IS_REFLECTION_EMIT) != 0; } - BOOL IsSystem() { WRAPPER_NO_CONTRACT; SUPPORTS_DAC; return m_pPEAssembly->IsSystem(); } + bool IsSystem() { WRAPPER_NO_CONTRACT; SUPPORTS_DAC; return m_pPEAssembly->IsSystem(); } virtual BOOL IsEditAndContinueCapable() const { return FALSE; } diff --git a/src/coreclr/vm/peassembly.cpp b/src/coreclr/vm/peassembly.cpp index 89021f76284100..a403def9846409 100644 --- a/src/coreclr/vm/peassembly.cpp +++ b/src/coreclr/vm/peassembly.cpp @@ -641,29 +641,34 @@ ULONG PEAssembly::GetPEImageTimeDateStamp() PEAssembly::PEAssembly( BINDER_SPACE::Assembly* pBoundAssembly, IMetaDataEmit* pEmit, - BOOL isSystem, + bool isSystem, AssemblyBinder* pDynamicAssemblyBinder /*= NULL*/) + : +#ifdef LOGGING + m_pDebugName{NULL}, +#endif // LOGGING + m_PEImage{NULL} + , m_MDImportIsRW_Debugger_Use_Only{FALSE} + , m_pMDImport{NULL} + , m_pImporter{NULL} + , m_pEmitter{NULL} + , m_refCount{1} + , m_isSystem{isSystem} + , m_pHostAssembly{nullptr} + , m_pAssemblyBinder{nullptr} { CONTRACTL { - PRECONDITION(CheckPointer(pEmit, NULL_OK)); + // A PEAssembly is either bound by an AssemblyBinder or dynamic (reflection emit) + PRECONDITION((pBoundAssembly == NULL) != (pEmit == NULL)); + // Only a bound assembly can be System.Private.CoreLib. + PRECONDITION(pEmit == NULL || !isSystem); + // A bound assembly takes its binder from the bind result, not from a caller. + PRECONDITION(pBoundAssembly == NULL || pDynamicAssemblyBinder == NULL); STANDARD_VM_CHECK; } CONTRACTL_END; -#ifdef LOGGING - m_pDebugName = NULL; -#endif // LOGGING - m_PEImage = NULL; - m_MDImportIsRW_Debugger_Use_Only = FALSE; - m_pMDImport = NULL; - m_pImporter = NULL; - m_pEmitter = NULL; - m_refCount = 1; - m_isSystem = isSystem; - m_pHostAssembly = nullptr; - m_pAssemblyBinder = nullptr; - PEImage* pPEImage = pBoundAssembly ? pBoundAssembly->GetPEImage() : NULL; if (pPEImage != NULL) { @@ -795,7 +800,7 @@ PEAssembly *PEAssembly::DoOpenSystem() ReleaseHolder pBoundAssembly; IfFailThrow(GetAppDomain()->GetDefaultBinder()->BindToSystem(&pBoundAssembly)); - return new PEAssembly(pBoundAssembly, NULL, TRUE); + return new PEAssembly(pBoundAssembly, NULL, /*isSystem*/ true); } PEAssembly* PEAssembly::Open(BINDER_SPACE::Assembly* pBoundAssembly) @@ -817,7 +822,7 @@ PEAssembly *PEAssembly::Create(IMetaDataAssemblyEmit *pAssemblyEmit, AssemblyBin // we have.) ReleaseHolder pEmit; pAssemblyEmit->QueryInterface(IID_IMetaDataEmit, (void **)&pEmit); - return new PEAssembly(NULL, pEmit, FALSE, pDynamicAssemblyBinder); + return new PEAssembly(NULL, pEmit, /*isSystem*/ false, pDynamicAssemblyBinder); } #endif // #ifndef DACCESS_COMPILE diff --git a/src/coreclr/vm/peassembly.h b/src/coreclr/vm/peassembly.h index 1b35c6df28f644..7939560944fe1f 100644 --- a/src/coreclr/vm/peassembly.h +++ b/src/coreclr/vm/peassembly.h @@ -50,9 +50,7 @@ typedef DPTR(PEAssembly) PTR_PEAssembly; // -------------------------------------------------------------------------------- // -------------------------------------------------------------------------------- -// A PEAssembly is an input to the CLR loader. It is produced as a result of -// binding, usually through fusion (although there are a few less common methods to -// obtain one which do not go through fusion, e.g. IJW loads) +// A PEAssembly is an input to the CLR loader. It is produced as a result of binding. // // Although a PEAssembly is usually a disk based PE file, it is not // always the case. Thus it is a conscious decision to not export access to the PE @@ -151,7 +149,7 @@ class PEAssembly final // Classification // ------------------------------------------------------------ - BOOL IsSystem() const; + bool IsSystem() const; BOOL IsReflectionEmit() const; // ------------------------------------------------------------ @@ -354,7 +352,7 @@ class PEAssembly final PEAssembly( BINDER_SPACE::Assembly* pBoundAssembly, IMetaDataEmit* pEmit, - BOOL isSystem, + bool isSystem, AssemblyBinder* pDynamicAssemblyBinder = NULL ); diff --git a/src/coreclr/vm/peassembly.inl b/src/coreclr/vm/peassembly.inl index b0e60c958e3338..03bbf5cdf9900d 100644 --- a/src/coreclr/vm/peassembly.inl +++ b/src/coreclr/vm/peassembly.inl @@ -221,7 +221,7 @@ inline LPCUTF8 PEAssembly::GetDebugName() // Classification // ------------------------------------------------------------ -inline BOOL PEAssembly::IsSystem() const +inline bool PEAssembly::IsSystem() const { LIMITED_METHOD_CONTRACT; SUPPORTS_DAC; From ce6548e7933fca0cbc01254c75b5e59a30c89bec Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Fri, 7 Aug 2026 20:01:32 -0700 Subject: [PATCH 3/6] Update comments --- src/coreclr/vm/peassembly.h | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/src/coreclr/vm/peassembly.h b/src/coreclr/vm/peassembly.h index 7939560944fe1f..b180a4c5b78a3a 100644 --- a/src/coreclr/vm/peassembly.h +++ b/src/coreclr/vm/peassembly.h @@ -37,18 +37,9 @@ // Forward declared classes // -------------------------------------------------------------------------------- -class Module; -class EditAndContinueModule; - class PEAssembly; -class SimpleRWLock; - typedef DPTR(PEAssembly) PTR_PEAssembly; -// -------------------------------------------------------------------------------- -// Types -// -------------------------------------------------------------------------------- - // -------------------------------------------------------------------------------- // A PEAssembly is an input to the CLR loader. It is produced as a result of binding. // @@ -57,23 +48,21 @@ typedef DPTR(PEAssembly) PTR_PEAssembly; // file directly; rather the specific information required should be provided via // individual query API. // -// There are multiple "flavors" of PEAssemblies: -// -// 1. HMODULE - these PE Files are loaded in response to "spontaneous" OS callbacks. -// These should only occur for .exe main modules and IJW dlls loaded via LoadLibrary -// or static imports in umnanaged code. -// These get their PEImage loaded directly in PEImage::CreateFromHMODULE(HMODULE hMod) +// A PEAssembly is one of two kinds, distinguished by IsReflectionEmit(): // -// 2. Assemblies loaded directly or indirectly by the managed code - these are the most -// common case. A path is obtained from assembly binding and the result is loaded -// via PEImage: -// a. Display name loads - these are metadata-based binds -// b. Path loads - these are loaded from an explicit path +// 1. Bound to a PE image - the result of an AssemblyBinder bind +// It holds the BINDER_SPACE::Assembly that the binder produced, and takes +// both its PEImage and its metadata from that bind result. // -// 3. Byte arrays - loaded explicitly by user code. These also go through PEImage. +// The PEImage may come from: +// - File on disk - loaded via binding to an assembly name or an explicit path +// - Byte array - via an API such as AssemblyLoadContext.LoadFromStream +// - HMODULE - IJW module already loaded into memory by the OS (Windows) +// The source of the PEImage does not change the PEAssembly itself. // -// 4. Dynamic - these are not actual PE images at all, but are placeholders -// for reflection-based modules. +// 2. Dynamic - a reflection emit assembly +// It has no PEImage. Its metadata comes from an IMetaDataEmit and it uses the binder +// of the assembly that created it. // // See also file:..\inc\corhdr.h#ManagedHeader for more on the format of managed images. // -------------------------------------------------------------------------------- From 2f7a85710560ed412fc71ed6b66427c594f59e00 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Fri, 7 Aug 2026 20:54:23 -0700 Subject: [PATCH 4/6] Remove PEAssembly::IsStrongNamed --- src/coreclr/vm/assembly.hpp | 6 ------ src/coreclr/vm/peassembly.h | 12 +----------- src/coreclr/vm/peassembly.inl | 16 ---------------- 3 files changed, 1 insertion(+), 33 deletions(-) diff --git a/src/coreclr/vm/assembly.hpp b/src/coreclr/vm/assembly.hpp index 47f35654203e85..0e209b3d8a2cfd 100644 --- a/src/coreclr/vm/assembly.hpp +++ b/src/coreclr/vm/assembly.hpp @@ -211,12 +211,6 @@ class Assembly return GetPEAssembly()->GetSimpleName(); } - BOOL IsStrongNamed() - { - WRAPPER_NO_CONTRACT; - return GetPEAssembly()->IsStrongNamed(); - } - const void *GetPublicKey(DWORD *pcbPK) { WRAPPER_NO_CONTRACT; diff --git a/src/coreclr/vm/peassembly.h b/src/coreclr/vm/peassembly.h index b180a4c5b78a3a..681c25b3bda943 100644 --- a/src/coreclr/vm/peassembly.h +++ b/src/coreclr/vm/peassembly.h @@ -19,17 +19,8 @@ #include "sstring.h" #include "peimage.h" #include "metadata.h" -#include "corhlpr.h" -#include "utilcode.h" -#include "loaderheap.h" -#include "sstring.h" -#include "ex.h" -#include "assemblyspecbase.h" +#include "../binder/inc/assembly.hpp" #include "eecontract.h" -#include "stackwalktypes.h" -#include -#include "slist.h" -#include "eventtrace.h" #include "assemblybinderutil.h" @@ -164,7 +155,6 @@ class PEAssembly final void GetMVID(GUID* pMvid); ULONG GetHashAlgId(); HRESULT GetVersion(USHORT* pMajor, USHORT* pMinor, USHORT* pBuild, USHORT* pRevision); - BOOL IsStrongNamed(); LPCUTF8 GetSimpleName(); HRESULT GetScopeName(LPCUTF8 * pszName); const void *GetPublicKey(DWORD *pcbPK); diff --git a/src/coreclr/vm/peassembly.inl b/src/coreclr/vm/peassembly.inl index 03bbf5cdf9900d..518cd7a69b938b 100644 --- a/src/coreclr/vm/peassembly.inl +++ b/src/coreclr/vm/peassembly.inl @@ -751,22 +751,6 @@ inline LPCSTR PEAssembly::GetSimpleName() return name; } -inline BOOL PEAssembly::IsStrongNamed() -{ - CONTRACTL - { - THROWS; - WRAPPER(GC_NOTRIGGER); - MODE_ANY; - } - CONTRACTL_END; - - DWORD flags = 0; - IfFailThrow(GetMDImport()->GetAssemblyProps(TokenFromRid(1, mdtAssembly), NULL, NULL, NULL, NULL, NULL, &flags)); - return (flags & afPublicKey) != 0; -} - - //--------------------------------------------------------------------------------------- // // Check to see if this assembly has had its strong name signature verified yet. From 027f5bdb35c64f1e6756553c6a0e2d312604dfcb Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Mon, 10 Aug 2026 22:15:48 -0700 Subject: [PATCH 5/6] Replace isSystem with check against SystemPEAssembly --- src/coreclr/vm/peassembly.cpp | 10 +++------- src/coreclr/vm/peassembly.h | 2 -- src/coreclr/vm/peassembly.inl | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/coreclr/vm/peassembly.cpp b/src/coreclr/vm/peassembly.cpp index a403def9846409..3392a45ccc4820 100644 --- a/src/coreclr/vm/peassembly.cpp +++ b/src/coreclr/vm/peassembly.cpp @@ -641,7 +641,6 @@ ULONG PEAssembly::GetPEImageTimeDateStamp() PEAssembly::PEAssembly( BINDER_SPACE::Assembly* pBoundAssembly, IMetaDataEmit* pEmit, - bool isSystem, AssemblyBinder* pDynamicAssemblyBinder /*= NULL*/) : #ifdef LOGGING @@ -653,7 +652,6 @@ PEAssembly::PEAssembly( , m_pImporter{NULL} , m_pEmitter{NULL} , m_refCount{1} - , m_isSystem{isSystem} , m_pHostAssembly{nullptr} , m_pAssemblyBinder{nullptr} { @@ -661,8 +659,6 @@ PEAssembly::PEAssembly( { // A PEAssembly is either bound by an AssemblyBinder or dynamic (reflection emit) PRECONDITION((pBoundAssembly == NULL) != (pEmit == NULL)); - // Only a bound assembly can be System.Private.CoreLib. - PRECONDITION(pEmit == NULL || !isSystem); // A bound assembly takes its binder from the bind result, not from a caller. PRECONDITION(pBoundAssembly == NULL || pDynamicAssemblyBinder == NULL); STANDARD_VM_CHECK; @@ -800,12 +796,12 @@ PEAssembly *PEAssembly::DoOpenSystem() ReleaseHolder pBoundAssembly; IfFailThrow(GetAppDomain()->GetDefaultBinder()->BindToSystem(&pBoundAssembly)); - return new PEAssembly(pBoundAssembly, NULL, /*isSystem*/ true); + return new PEAssembly(pBoundAssembly, NULL); } PEAssembly* PEAssembly::Open(BINDER_SPACE::Assembly* pBoundAssembly) { - return new PEAssembly(pBoundAssembly, NULL, /*isSystem*/ false); + return new PEAssembly(pBoundAssembly, NULL); }; /* static */ @@ -822,7 +818,7 @@ PEAssembly *PEAssembly::Create(IMetaDataAssemblyEmit *pAssemblyEmit, AssemblyBin // we have.) ReleaseHolder pEmit; pAssemblyEmit->QueryInterface(IID_IMetaDataEmit, (void **)&pEmit); - return new PEAssembly(NULL, pEmit, /*isSystem*/ false, pDynamicAssemblyBinder); + return new PEAssembly(NULL, pEmit, pDynamicAssemblyBinder); } #endif // #ifndef DACCESS_COMPILE diff --git a/src/coreclr/vm/peassembly.h b/src/coreclr/vm/peassembly.h index 681c25b3bda943..937aac0bcc342f 100644 --- a/src/coreclr/vm/peassembly.h +++ b/src/coreclr/vm/peassembly.h @@ -331,7 +331,6 @@ class PEAssembly final PEAssembly( BINDER_SPACE::Assembly* pBoundAssembly, IMetaDataEmit* pEmit, - bool isSystem, AssemblyBinder* pDynamicAssemblyBinder = NULL ); @@ -381,7 +380,6 @@ class PEAssembly final IMetaDataEmit* m_pEmitter; Volatile m_refCount; - bool m_isSystem; PTR_BINDER_SPACE_Assembly m_pHostAssembly; PTR_AssemblyBinder m_pAssemblyBinder; diff --git a/src/coreclr/vm/peassembly.inl b/src/coreclr/vm/peassembly.inl index 518cd7a69b938b..f16144a1e0ac39 100644 --- a/src/coreclr/vm/peassembly.inl +++ b/src/coreclr/vm/peassembly.inl @@ -226,7 +226,7 @@ inline bool PEAssembly::IsSystem() const LIMITED_METHOD_CONTRACT; SUPPORTS_DAC; - return m_isSystem; + return this == SystemDomain::SystemPEAssembly(); } inline BOOL PEAssembly::IsReflectionEmit() const From 97875de5d83daff707f6c03aad09e741bde83bc5 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Mon, 10 Aug 2026 22:16:34 -0700 Subject: [PATCH 6/6] Apply suggestion from @AaronRobinsonMSFT Co-authored-by: Aaron R Robinson --- src/coreclr/vm/peassembly.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/vm/peassembly.h b/src/coreclr/vm/peassembly.h index 937aac0bcc342f..92f2c93732a0b1 100644 --- a/src/coreclr/vm/peassembly.h +++ b/src/coreclr/vm/peassembly.h @@ -325,7 +325,7 @@ class PEAssembly final #ifdef DACCESS_COMPILE // just to make the DAC and GCC happy. - ~PEAssembly() {}; + ~PEAssembly() = default; PEAssembly() = default; #else PEAssembly(