dotnet / dotnet/runtime

RuntimeCustomAttributeData doesn't distinguish field/property metadata

Open
#133,652 1 comment 0 reactions 0 assignees View on GitHub
area-System.Reflection
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

https://github.com/dotnet/runtime/blob/3898c7135c4dc861e00f49285d0c275f69e2e6c5/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs#L730-L736

This is validated, but not actually used. Property aliasing a field could materialize wrong Property/Field Info.

This is trivial to fix but this code is in the process of getting unified with native AOT so do not assign to copilot this year (pull requests are in flight right now and there might be more and this will be a very unnecessary merge conflict).

Contributor guide

Open the contributing guide

Research direction

Start in src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs at lines 730-736, then read the surrounding metadata handling. Check where the validated field/property distinction is used and verify that aliased fields do not materialize the wrong PropertyInfo or FieldInfo. Coordinate with the in-flight native AOT unification work before changing this area.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.