summary refs log tree commit diff stats
path: root/compiler/semfold.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semfold.nim')
-rw-r--r--compiler/semfold.nim6
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/semfold.nim b/compiler/semfold.nim
index ec3ebd65b..ec2d646c8 100644
--- a/compiler/semfold.nim
+++ b/compiler/semfold.nim
@@ -434,15 +434,12 @@ proc foldConv(n, a: PNode; g: ModuleGraph; check = false): PNode =
   let dstTyp = skipTypes(n.typ, abstractRange - {tyTypeDesc})
   let srcTyp = skipTypes(a.typ, abstractRange - {tyTypeDesc})
 
-
   # if srcTyp.kind == tyUInt64 and "FFFFFF" in $n:
   #   echo "n: ", n, " a: ", a
   #   echo "from: ", srcTyp, " to: ", dstTyp, " check: ", check
   #   echo getInt(a)
   #   echo high(int64)
   #   writeStackTrace()
-
-  # XXX range checks?
   case dstTyp.kind
   of tyInt..tyInt64, tyUInt..tyUInt64:
     case srcTyp.kind
@@ -450,9 +447,10 @@ proc foldConv(n, a: PNode; g: ModuleGraph; check = false): PNode =
       result = newIntNodeT(toInt128(getFloat(a)), n, g)
     of tyChar, tyUInt..tyUInt64, tyInt..tyInt64:
       var val = a.getOrdValue
+
       if check: rangeCheck(n, val, g)
       result = newIntNodeT(val, n, g)
-      if dstTyp.kind in {tyUInt .. tyUInt64}:
+      if dstTyp.kind in {tyUInt..tyUInt64}:
         result.kind = nkUIntLit
     else:
       result = a