Repository navigation
ilverify doesn't respect IgnoreAccessChecksTo #130959
Copy link
Copy link
Closed
Labels
area-Tools-ILVerificationIssues related to ilverify tool and IL verification in generalIssues related to ilverify tool and IL verification in general
Milestone
Description
runtime/src/coreclr/tools/ILVerification/AccessVerificationHelpers.cs
Lines 99 to 124 in 7f416ac
| private static bool CanAccessMember(this MetadataType currentType, TypeDesc targetType, MethodAttributes memberVisibility, TypeDesc instance) | |
| { | |
| if (instance == null) | |
| instance = currentType; | |
| // Check access to class defining member | |
| if (!currentType.CanAccess(targetType)) | |
| return false; | |
| var targetTypeDef = (MetadataType)targetType.GetTypeDefinition(); | |
| if (memberVisibility == MethodAttributes.Public) | |
| return true; | |
| // This is module-scope checking, to support C++ file & function statics. | |
| if (memberVisibility == MethodAttributes.PrivateScope) | |
| return currentType.Module == targetTypeDef.Module; | |
| if (memberVisibility == MethodAttributes.Assembly) | |
| return currentType.Module == targetTypeDef.Module || targetTypeDef.Module.GrantsFriendAccessTo(currentType.Module); | |
| if (memberVisibility == MethodAttributes.FamANDAssem) | |
| { | |
| if (currentType.Module != targetTypeDef.Module && !targetTypeDef.Module.GrantsFriendAccessTo(currentType.Module)) | |
| return false; | |
| } |
ilverify currently only respects InternalsVisibleToAttribute, it should also handle and return true for IgnoreAccessChecksTo.
@jkotas could you get copilot on this if you have no objections?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-Tools-ILVerificationIssues related to ilverify tool and IL verification in generalIssues related to ilverify tool and IL verification in general
Activity
dotnet-policy-service commentedon Jul 17, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Jul 17, 2026
Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib
See info in area-owners.md if you want to be subscribed.
ilverify: respect IgnoresAccessChecksToAttribute
ilverify: IgnoresAccessChecksTo behind an option
ilverify: respect IgnoresAccessChecksToAttribute (dotnet#136033)