summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-09-03 11:11:43 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-09-03 11:12:19 +0200
commitc2df609cd6b7da970044eab0e223c5c8ec06a58f (patch)
tree55a3fd5ae3e4fb27a910a7582fc6b5f0d347d25f
parent0e9d12639eb896797696925f84ad773a5906d980 (diff)
downloadNim-c2df609cd6b7da970044eab0e223c5c8ec06a58f.tar.gz
fixes a compiler crash; refs #4699
-rw-r--r--compiler/semfold.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/semfold.nim b/compiler/semfold.nim
index 1cb726053..42fa60781 100644
--- a/compiler/semfold.nim
+++ b/compiler/semfold.nim
@@ -514,7 +514,8 @@ proc foldConv*(n, a: PNode; check = false): PNode =
     else:
       result = a
       result.typ = n.typ
-    if check: rangeCheck(n, result.intVal)
+    if check and result.kind in {nkCharLit..nkUInt64Lit}:
+      rangeCheck(n, result.intVal)
   of tyFloat..tyFloat64:
     case skipTypes(a.typ, abstractRange).kind
     of tyInt..tyInt64, tyEnum, tyBool, tyChar: