Skip to content

Conversation

@ktopley-apple
Copy link
Contributor

@ktopley-apple ktopley-apple commented Oct 11, 2017

…imeNanoseconds values.

(rdar://problem/34922683)

[related to change https://github.com/swiftlang/swift/pull/12387]

The change is in three parts:

The value UInt64.max passed to the DispatchTime initializer means DISPATCH_TIME_FOREVER and should not be scaled using the Mach timebase.
The scaling calculations need to detect overflow and clamp to UInt64.max if this occurs, making the value equal to DISPATCH_TIME_FOREVER
The getter for the uptimeNanoseconds also needs to be protected against overflow and return UInt64.max if it occurs.

@ktopley-apple
Copy link
Contributor Author

@swift-ci please test

@ktopley-apple ktopley-apple force-pushed the dispatch-timebase-overflow branch from abbe7d2 to 6aedc05 Compare October 12, 2017 15:14
@ktopley-apple
Copy link
Contributor Author

@swift-ci please test

@ktopley-apple ktopley-apple force-pushed the dispatch-timebase-overflow branch from 6aedc05 to 4195ac6 Compare October 16, 2017 14:12
@ktopley-apple
Copy link
Contributor Author

Squashed commits

@ktopley-apple ktopley-apple merged commit 12c9ca8 into master Oct 16, 2017
ktopley-apple added a commit that referenced this pull request Dec 6, 2018
Fixes overflow trap when creating DispatchTime objects with large upt…

Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
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.

4 participants