Remove unused parameters from CanAccess checks#120571
Merged
jkotas merged 3 commits intodotnet:mainfrom Oct 15, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR removes unused parameters from access control checking methods in the CoreCLR runtime. The changes eliminate parameters that were previously used for transparency checks but are no longer needed after simplification of the access control system.
Key changes:
- Removes unused
pOptionalTargetFieldparameters fromCanAccessand related methods - Simplifies
GrantsFriendAccessTomethods to only take the accessing assembly parameter - Updates all call sites to match the simplified method signatures
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/clsload.hpp | Removes pOptionalTargetField parameter from CanAccess method declarations |
| src/coreclr/vm/clsload.cpp | Updates CanAccess implementation and removes unused parameters from helper methods |
| src/coreclr/vm/assembly.hpp | Simplifies GrantsFriendAccessTo method signatures to remove member-specific overloads |
| src/coreclr/vm/assembly.cpp | Consolidates multiple GrantsFriendAccessTo overloads into single method |
| src/coreclr/vm/runtimehandles.cpp | Removes NULL parameter from CanAccess call |
| src/coreclr/vm/methodtablebuilder.cpp | Updates GrantsFriendAccessTo calls to use simplified signature |
| src/coreclr/vm/jitinterface.cpp | Removes unused parameters from multiple CanAccess calls |
| src/coreclr/vm/dllimport.cpp | Updates CanAccess call to match new signature |
Contributor
|
Tagging subscribers to this area: @mangod9 |
jkotas
approved these changes
Oct 9, 2025
Member
Author
|
In the past these were used as part of much more elaborate transparency and such checks, but we don't do that anymore. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the past these were used as part of much more elaborate transparency and such checks, but we don't do that anymore.