From f3e088f11ad28de182dca77cf9361e72c8db0fb2 Mon Sep 17 00:00:00 2001 From: Miran Date: Fri, 15 Nov 2019 12:37:43 +0100 Subject: [PATCH] remove two asserts in int128.nim (#12648) [backport] Before this PR, `tests/misc/tconv.nim` fails when the compiler is compiled without `-d:danger` flag. Bear in mind that even without the asserts, the values outside of a given range are still checked and a meaningful error message (from `compiler/semexprs.nim`) is printed. (cherry picked from commit 107b40f09757c0db1405d5e3e7d3ffead7bacc54) --- compiler/int128.nim | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/int128.nim b/compiler/int128.nim index 361f854f2e..23079569af 100644 --- a/compiler/int128.nim +++ b/compiler/int128.nim @@ -549,8 +549,6 @@ template bitor(a,b,c: Int128): Int128 = bitor(bitor(a,b), c) proc toInt128*(arg: float64): Int128 = let isNegative = arg < 0 - assert(arg < 0x47E0000000000000'f64, "out of range") - assert(arg >= 0xC7E0000000000000'f64, "out of range") let v0 = ldexp(abs(arg), -100) let w0 = uint64(trunc(v0)) let v1 = ldexp(v0 - float64(w0), 50)