summaryrefslogtreecommitdiff
path: root/rts/win32/AsyncIO.h
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/win32/AsyncIO.h
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/win32/AsyncIO.h')
-rw-r--r--rts/win32/AsyncIO.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/rts/win32/AsyncIO.h b/rts/win32/AsyncIO.h
index bedbf5b67b..3737db087a 100644
--- a/rts/win32/AsyncIO.h
+++ b/rts/win32/AsyncIO.h
@@ -10,11 +10,11 @@
extern unsigned int
addIORequest(int fd,
- int forWriting,
- int isSock,
- int len,
+ bool forWriting,
+ bool isSock,
+ HsInt len,
char* buf);
-extern unsigned int addDelayRequest(int usecs);
+extern unsigned int addDelayRequest(HsInt usecs);
extern unsigned int addDoProcRequest(void* proc, void* param);
extern int startupAsyncIO(void);
extern void shutdownAsyncIO(bool wait_threads);