summaryrefslogtreecommitdiff
path: root/rts/RtsUtils.c
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2016-12-17 18:08:00 -0500
committerBen Gamari <ben@smart-cactus.org>2016-12-17 18:09:40 -0500
commit2d1beb1ec84c2d22c6be83944ef4ea8626abd76a (patch)
tree2a722f9d0e9abf2dc40c35e387c3df0fd82729c5 /rts/RtsUtils.c
parent3dbd2b097aeb9217f4a7fc87e610e6983ebbce7b (diff)
downloadhaskell-2d1beb1ec84c2d22c6be83944ef4ea8626abd76a.tar.gz
rts/win32/IOManager: Fix integer types
This code has been broken on 64-bit systems for some time: the length and timeout arguments of `addIORequest` and `addDelayRequest`, respectively, were declared as `int`. However, they were passed Haskell integers from their respective primops. Integer overflow and madness ensued. This resulted in #7325 and who knows what else. Also, there were a few left-over `BOOL`s in here which were not passed to Windows system calls; these were changed to C99 `bool`s. However, there is still a bit of signedness inconsistency within the `delay#` call-chain, * `GHC.Conc.IO.threadDelay` and the `delay#` primop accept `Int` arguments * The `delay#` implementation in `PrimOps.cmm` expects the timeout as a `W_` * `AsyncIO.c:addDelayRequest` expects an `HsInt` (was `int` prior to this patch) * `IOManager.c:AddDelayRequest` expects an `HsInt`` (was `int`) * The Windows `Sleep` function expects a `DWORD` (which is unsigned) Test Plan: Validate on Windows Reviewers: erikd, austin, simonmar, Phyx Reviewed By: Phyx Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2861 GHC Trac Issues: #7325
Diffstat (limited to 'rts/RtsUtils.c')
0 files changed, 0 insertions, 0 deletions