Skip to content

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

Merged
lorentey merged 1 commit intoswiftlang:mainfrom
lorentey:duration-components-crash
Jul 11, 2022
Merged

[stdlib] Duration: Fix rare overflow trap in Int128.multipliedFullWidth#59959
lorentey merged 1 commit intoswiftlang:mainfrom
lorentey:duration-components-crash

Conversation

@lorentey
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

lorentey commented Jul 8, 2022

@swift-ci test

@lorentey lorentey merged commit 5788a2c into swiftlang: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.

2 participants