Skip to content

Commit 87dc182

Browse files
authored
fixes overflow defect when compiled with js backend (nim-lang#25132)
Follow up to nim-lang#25126. This fixes overflow defect when `tests/stdlib/tstrutils.nim` was compiled with js backend.
1 parent 065c4b4 commit 87dc182

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/stdlib/tstrutils.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,8 @@ bar
789789
block: # formatSize
790790
disableVm:
791791
when hasWorkingInt64:
792-
doAssert formatSize(1024 * 1024 * 1024 * 2 - 1) == "1.999GiB"
793-
doAssert formatSize(1024 * 1024 * 1024 * 2) == "2GiB"
792+
doAssert formatSize(1024'i64 * 1024 * 1024 * 2 - 1) == "1.999GiB"
793+
doAssert formatSize(1024'i64 * 1024 * 1024 * 2) == "2GiB"
794794
doAssert formatSize((1'i64 shl 31) + (300'i64 shl 20)) == "2.293GiB" # <=== bug #8231
795795
doAssert formatSize(int64.high) == "7.999EiB"
796796
doAssert formatSize(int64.high div 2 + 1) == "4EiB"

0 commit comments

Comments
 (0)