From c2df609cd6b7da970044eab0e223c5c8ec06a58f Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 3 Sep 2016 11:11:43 +0200 Subject: [PATCH] fixes a compiler crash; refs #4699 --- compiler/semfold.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 1cb726053c..42fa607813 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: