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

[mono] Fix downcast check in Array.CopySlow #64469

Merged
merged 2 commits into from
Jan 30, 2022

Conversation

lambdageek
Copy link
Member

When we have to resort to checking element by element, compare the type of each actual element with the destination type. In particular, not the destinations underlying type when it's an enum - we don't want to allow unrelated enums using the same representation to copy over.

Fixes #64387

where each element in the source array is the appropriate type
When we have to resort to checking element by element, compare the type of each
actual element with the destination type. In particular, not the destinations
underlying type when it's an enum - we don't want to allow unrelated enums
using the same representation to copy over.

Fixes dotnet#64387
@lambdageek
Copy link
Member Author

/cc @lewing

Copy link
Member

@lewing lewing left a comment

Choose a reason for hiding this comment

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

LGTM

@lambdageek
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1764177051

@lambdageek lambdageek merged commit bc6d349 into dotnet:main Jan 30, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Mar 2, 2022
@lambdageek lambdageek deleted the fix-gh-64387 branch March 19, 2022 16:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ArrayList.ToArray(type) throws exception for enum type in Blazor WebAssembly
2 participants