base/TimerManager: Clamp timer expiration time to maxBound
authorBen Gamari <bgamari.foss@gmail.com>
Thu, 31 May 2018 00:39:12 +0000 (20:39 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 31 May 2018 02:05:37 +0000 (22:05 -0400)
commit21a9fb5ff3714addf28dbe270af5d10640d89ad9
tree72197284de8cfb0b130899628be3a899e3b9f481
parentd1beebb881722109d6935941e541eb175a9d6c62
base/TimerManager: Clamp timer expiration time to maxBound

Previously we would allow the expiration time to overflow, which in
practice meant that `threadDelay maxBound` we return far earlier than
circa 2500 CE. For now we fix this by simply clamping to maxBound.

Fixes #15158.

Test Plan: Validate, run T8089

Reviewers: simonmar, hvr

Reviewed By: simonmar

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15158

Differential Revision: https://phabricator.haskell.org/D4719
libraries/base/GHC/Event/TimerManager.hs
libraries/base/tests/all.T