Skip to content

Fix logic error in AttributedString.Runs.== for empty collections #4635

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

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

jmschonfeld
Copy link
Contributor

This corrects an issue in the AttributedString.Runs equality check when both collections are empty. Previously this led to an array out of bounds access when attempting to compare a run in the collection that did not exist. This also refactors the code a bit to make it more readable.

Resolves #4634

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld jmschonfeld merged commit de5f7ed into swiftlang:main Sep 22, 2022
@jmschonfeld jmschonfeld deleted the empty-run-equality-crash branch September 22, 2022 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributedSubstring.== crashes on empty strings
1 participant