summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-08-08 11:32:19 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-08-08 11:32:19 +0200
commitce4d9e40fe23b08ff240e28f79eb44b89c4c7384 (patch)
tree3a67aff8aa48fbdbae52a0e24d645dfd102c8aef /compiler
parent7426e9c24639a482930afe9f48c096d7ff726e98 (diff)
downloadNim-ce4d9e40fe23b08ff240e28f79eb44b89c4c7384.tar.gz
fixes #4582
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index a86409e50..f4068b2a2 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -2177,7 +2177,8 @@ proc genConstSimpleList(p: BProc, n: PNode): Rope =
   result = rope("{")
   for i in countup(ord(n.kind == nkObjConstr), length - 2):
     addf(result, "$1,$n", [genNamedConstExpr(p, n.sons[i])])
-  if length > 0: add(result, genNamedConstExpr(p, n.sons[length - 1]))
+  if length > ord(n.kind == nkObjConstr):
+    add(result, genNamedConstExpr(p, n.sons[length - 1]))
   addf(result, "}$n", [])
 
 proc genConstSeq(p: BProc, n: PNode, t: PType): Rope =