-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add unit test for issue #7346 (custom attribute constructor crash on null array of enums) #120641
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: stephentoub <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a unit test to verify that a crash issue with custom attribute constructors receiving null arrays of enums has been fixed. The issue (dotnet/coreclr#7346) caused crashes when custom attributes with null enum array parameters were processed through reflection.
- Adds a test case that applies a custom attribute with a null enum array parameter and verifies it can be retrieved safely
- Introduces supporting types (
MyTestEnum
andMyEnumArrayAttribute
) for the test - Validates that the fix prevents crashes and correctly handles null array values in custom attribute reflection
...ries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/CustomAttributeDataTests.cs
Show resolved
Hide resolved
...ries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/CustomAttributeDataTests.cs
Outdated
Show resolved
Hide resolved
...ries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/CustomAttributeDataTests.cs
Show resolved
Hide resolved
...ries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/CustomAttributeDataTests.cs
Show resolved
Hide resolved
Co-authored-by: jkotas <[email protected]>
Head branch was pushed to by a user without write access
...ries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/CustomAttributeDataTests.cs
Show resolved
Hide resolved
…/Reflection/CustomAttributeDataTests.cs
Plan to add unit test for issue #7346 (custom attribute constructor crash on null array of enums):
Original prompt
Fixes #18847
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.