From 2da438c33b55ddfefd5d0e5e876721a00dabd42c Mon Sep 17 00:00:00 2001 From: alaviss Date: Thu, 26 Mar 2020 08:26:56 +0000 Subject: [PATCH] asyncdispatch: fix erroneous set construction (#13765) These constants were defined as `cint`. They can be huge on certain systems, such as Haiku, and trigger out-of-bounds errors in asyncdispatch. Ref #13764. --- lib/pure/asyncdispatch.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/pure/asyncdispatch.nim b/lib/pure/asyncdispatch.nim index 4ab0cf214..5d34f9fca 100644 --- a/lib/pure/asyncdispatch.nim +++ b/lib/pure/asyncdispatch.nim @@ -1407,7 +1407,9 @@ else: MSG_NOSIGNAL) if res < 0: let lastError = osLastError() - if lastError.int32 notin {EINTR, EWOULDBLOCK, EAGAIN}: + if lastError.int32 != EINTR and + lastError.int32 != EWOULDBLOCK and + lastError.int32 != EAGAIN: if flags.isDisconnectionError(lastError): retFuture.complete() else: