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

[stdlib] Duration: Fix rare overflow trap in Int128.multipliedFullWidth #59959

Merged
merged 1 commit into from Jul 11, 2022

Conversation

lorentey
Copy link
Member

@lorentey lorentey commented Jul 8, 2022

Int128.multipliedFullWidth fails to account for an overflow case, which results in Duration.components trapping when the duration is a multiple of 512s.

rdar://96362510

Int128.multipliedFullWidth fails to account for an overflow case, which lead `Duration.components` trapping when the duration is a multiple of 512s.

rdar://96362510
@lorentey
Copy link
Member Author

lorentey commented Jul 8, 2022

Cc @stephentyrone we really need a properly tested Int128 implementation -- this code came from DoubleWidth & it's rudimentary at best.

@lorentey
Copy link
Member Author

lorentey commented Jul 8, 2022

@swift-ci test

@lorentey lorentey merged commit 5788a2c into apple:main Jul 11, 2022
@lorentey lorentey deleted the duration-components-crash branch July 11, 2022 19:30
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.

None yet

2 participants