summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authoralaviss <alaviss@users.noreply.github.com>2020-03-26 08:26:56 +0000
committerGitHub <noreply@github.com>2020-03-26 09:26:56 +0100
commit2da438c33b55ddfefd5d0e5e876721a00dabd42c (patch)
tree7a806b4526cc41bbe642b44e9dd480d37a03f16c /lib
parente50441ab33d1b287a89ad4e2d795c80b7f8077c0 (diff)
downloadNim-2da438c33b55ddfefd5d0e5e876721a00dabd42c.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/asyncdispatch.nim4
1 files changed, 3 insertions, 1 deletions
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: