Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix value type unboxing bug #69815

Merged
merged 3 commits into from
May 26, 2022
Merged

Fix value type unboxing bug #69815

merged 3 commits into from
May 26, 2022

Conversation

buyaa-n
Copy link
Member

@buyaa-n buyaa-n commented May 25, 2022

Fixes: #67989

As @jkotas mentioned:

The MethodDesc* should be always normalized using MethodDesc::FindOrCreateAssociatedMethodDescForReflection before MethodInfos are created for them. This normalization seems to be missing in Delegate.Method

Plus unboxing logic in MethodDesc::FindOrCreateAssociatedMethodDescForReflection() has a bug which causing issue for value types

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ghost
Copy link

ghost commented May 25, 2022

Tagging subscribers to this area: @dotnet/area-system-reflection
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes: #67989

As @jkotas mentioned: "The MethodDesc* should be always normalized using MethodDesc::FindOrCreateAssociatedMethodDescForReflection before MethodInfos are created for them. This normalization seems to be missing in Delegate.Method implementation" plus unboxing logic in MethodDesc::FindOrCreateAssociatedMethodDescForReflection() has a bug which causing issue for value types

Author: buyaa-n
Assignees: buyaa-n
Labels:

area-System.Reflection

Milestone: -

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@buyaa-n
Copy link
Member Author

buyaa-n commented May 26, 2022

Thank for the review and suggestions, the 2 failures looks unrelated and reported: #64944 #69806, so merging

@buyaa-n buyaa-n merged commit 5734a23 into dotnet:main May 26, 2022
@buyaa-n buyaa-n deleted the struct_unboxing branch May 26, 2022 21:15
@ghost ghost locked as resolved and limited conversation to collaborators Jun 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MethodInfo objects for same method are not equal
3 participants