DispatchTimeInterval & Date: avoid 32-bit overflows, fix watchOS crashes#2341
Merged
NachoSoto merged 2 commits intowatchos-testsfrom Mar 16, 2023
Merged
Conversation
d4c7aee to
834455f
Compare
834455f to
921d312
Compare
NachoSoto
commented
Mar 16, 2023
|
|
||
| import Foundation | ||
|
|
||
| extension NSDate { |
Contributor
Author
There was a problem hiding this comment.
No need to keep using NSDate anymore.
DispatchTimeInterval: avoid 32-bit overflows, fix watchOS crashesDispatchTimeInterval & Date: avoid 32-bit overflows, fix watchOS crashes
aboedo
approved these changes
Mar 16, 2023
Contributor
Author
|
Reopened: #2342 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2338, SDKONCALL-237, [SDK-2974].
Intis actually 32 bits in 32-bit platforms, likewatchOSstill is (sort of).This fixes 2 potential
Intoverflows:Date.millisecondsSince1970andDispatchTimeIntervalarithmetic usingnanoseconds.See also #2340.