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

Prevent stack overflow in Attribute.cs #111225

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leotsarev
Copy link
Contributor

fixes #35784

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jan 9, 2025
Copy link
Contributor

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

@teo-tsirpanis
Copy link
Contributor

The comment is incorrect, but I'm not sure whether behavior needs to change. An Attribute containing an Attribute does not necessarily lead to stack overflows; it does only if there is a cycle, and if there is, a custom override of the Equals method looks better.

Are there any real-world examples that would need this fix?

@leotsarev
Copy link
Contributor Author

Real life example was from my code (see original bug).

@leotsarev
Copy link
Contributor Author

I agree that custom Equals override should be better, but I think that framework should show correct error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Runtime community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comment in Attribute.cs is not correct
2 participants