Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Description

The isNewNativeImage out parameter in NativeImage::Open was being populated but never used by the sole caller in AssemblyBinder::LoadNativeImage.

Changes

  • Removed isNewNativeImage parameter from method signature in nativeimage.h and nativeimage.cpp
  • Removed three assignments to *isNewNativeImage in the implementation
  • Removed unused local variable at call site in assemblybinder.cpp

Files Changed

  • src/coreclr/vm/nativeimage.h
  • src/coreclr/vm/nativeimage.cpp
  • src/coreclr/vm/assemblybinder.cpp

cc @dotnet/appmodel @AaronRobinsonMSFT

Original prompt

The isNewNativeImage parameter to NativeImage::Open does not appear to be used. Remove it.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @elinor-fung
See info in area-owners.md if you want to be subscribed.

@elinor-fung elinor-fung marked this pull request as ready for review January 30, 2026 17:23
Copilot AI review requested due to automatic review settings January 30, 2026 17:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes an unused isNewNativeImage out parameter from NativeImage::Open and cleans up its only call site, simplifying the native image loading path.

Changes:

  • Updated NativeImage::Open declaration in nativeimage.h to drop the /* out */ bool *isNewNativeImage parameter.
  • Updated the implementation in nativeimage.cpp by removing all assignments to *isNewNativeImage and aligning the signature with the header.
  • Simplified AssemblyBinder::LoadNativeImage in assemblybinder.cpp by removing the unused isNewNativeImage local and updating the call to NativeImage::Open.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/coreclr/vm/nativeimage.h Adjusts the NativeImage::Open API to remove the unused out parameter from the declaration.
src/coreclr/vm/nativeimage.cpp Keeps the implementation in sync with the new signature and removes dead assignments to isNewNativeImage.
src/coreclr/vm/assemblybinder.cpp Cleans up the only call site by removing the unused local and calling the simplified NativeImage::Open overload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants