-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[6.1][stdlib] Fix recoverable [U]Int128 division-by-zero (#78045)
* Fix recoverable [U]Int128 division-by-zero This patch fixes the division-by-zero case in the following methods: - `Int128/dividedReportingOverflow(by:)` - `Int128/remainderReportingOverflow(dividingBy:)` - `UInt128/dividedReportingOverflow(by:)` - `UInt128/remainderReportingOverflow(dividingBy:)` * Add preconditions to trapping [U]Int128 division methods. * Make consistent use of `_slowPath(_:)`. Jumping on the `_slowPath(_:)` bandwagon like all other integer types. * Copy existing UInt128 division comments to division operators. * Add a comment about signed remainder overflow semantics as requested. I have paraphrased @stephentyrone's and @xwu's review comments to the best of my ability.
- Loading branch information
Showing
2 changed files
with
48 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters