Fix 32-bit failure on Nim 1.6 (#116)

* Nim 1.6 compiletime can now be affected by https://github.com/status-im/nim-stint/issues/92 ?

* seems like it happens on runtime too
This commit is contained in:
Mamy Ratsimbazafy 2022-01-13 12:04:26 +01:00 committed by GitHub
parent e17113fb31
commit ddfa6c608a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -228,6 +228,9 @@ template testAddSub(chk, tst: untyped) =
chkNegation(chk, 127, -127, 128)
chkNegation(chk, 32768, -32768, 128)
chkNegation(chk, 32767, -32767, 128)
# With Nim 1.6, it seems like https://github.com/status-im/nim-stint/issues/92
# can now happen on 32-bit platforms.
when (NimMajor,NimMinor,NimPatch) < (1,6,0):
chkNegation(chk, 2147483648, -2147483648, 128)
chkNegation(chk, 2147483647, -2147483647, 128)
#chkNegation(chk, 9223372036854775808, -9223372036854775808, 128) # TODO: bug #92