From a60403b9e7f28c646cfdba69b9fc292a87c7111c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 21:46:22 +0000 Subject: [PATCH 1/2] Initial plan From 4ec5896c0414dd488a0d50baef118272d10ba3d7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 21:50:21 +0000 Subject: [PATCH 2/2] Remove unused isNewNativeImage parameter from NativeImage::Open Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com> --- src/coreclr/vm/assemblybinder.cpp | 3 +-- src/coreclr/vm/nativeimage.cpp | 6 +----- src/coreclr/vm/nativeimage.h | 3 +-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/coreclr/vm/assemblybinder.cpp b/src/coreclr/vm/assemblybinder.cpp index 9f055457ea87e1..92f06deec37e57 100644 --- a/src/coreclr/vm/assemblybinder.cpp +++ b/src/coreclr/vm/assemblybinder.cpp @@ -34,8 +34,7 @@ NativeImage* AssemblyBinder::LoadNativeImage(Module* componentModule, LPCUTF8 na AppDomain::LoadLockHolder lock(AppDomain::GetCurrentDomain()); PTR_LoaderAllocator moduleLoaderAllocator = componentModule->GetLoaderAllocator(); - bool isNewNativeImage; - NativeImage* nativeImage = NativeImage::Open(componentModule->GetPath(), nativeImageName, this, moduleLoaderAllocator, isPlatformNative, &isNewNativeImage); + NativeImage* nativeImage = NativeImage::Open(componentModule->GetPath(), nativeImageName, this, moduleLoaderAllocator, isPlatformNative); return nativeImage; } diff --git a/src/coreclr/vm/nativeimage.cpp b/src/coreclr/vm/nativeimage.cpp index 1d6a0593d09897..3e068dcabafc26 100644 --- a/src/coreclr/vm/nativeimage.cpp +++ b/src/coreclr/vm/nativeimage.cpp @@ -224,15 +224,13 @@ NativeImage *NativeImage::Open( LPCUTF8 nativeImageFileName, AssemblyBinder *pAssemblyBinder, LoaderAllocator *pLoaderAllocator, - bool isPlatformNative, - /* out */ bool *isNewNativeImage) + bool isPlatformNative) { STANDARD_VM_CONTRACT; NativeImage *pExistingImage = AppDomain::GetCurrentDomain()->GetNativeImage(nativeImageFileName); if (pExistingImage != nullptr) { - *isNewNativeImage = false; if (pExistingImage->GetAssemblyBinder() == pAssemblyBinder) { return pExistingImage; @@ -292,12 +290,10 @@ NativeImage *NativeImage::Open( if (pExistingImage == nullptr) { // No pre-existing image, new image has been stored in the map - *isNewNativeImage = true; amTracker.SuppressRelease(); return image.Extract(); } // Return pre-existing image if it was loaded into the same ALC, null otherwise - *isNewNativeImage = false; if (pExistingImage->GetAssemblyBinder() == pAssemblyBinder) { return pExistingImage; diff --git a/src/coreclr/vm/nativeimage.h b/src/coreclr/vm/nativeimage.h index 47aa95c512c839..56a9abc7baa9b2 100644 --- a/src/coreclr/vm/nativeimage.h +++ b/src/coreclr/vm/nativeimage.h @@ -111,8 +111,7 @@ class NativeImage LPCUTF8 nativeImageFileName, AssemblyBinder *pAssemblyBinder, LoaderAllocator *pLoaderAllocator, - bool isPlatformNative, - /* out */ bool *isNewNativeImage); + bool isPlatformNative); Crst *EagerFixupsLock() { return &m_eagerFixupsLock; } bool EagerFixupsHaveRun() const { return m_eagerFixupsHaveRun; }