From 15c63b8011327c20acab5d155e0d5b0bd1e7c205 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Wed, 13 Jan 2016 16:06:31 +0100 Subject: [PATCH] fixes a long standing codegen bug concerning closures --- compiler/ccgexprs.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index e12a3bce2..73120bc93 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -1838,8 +1838,8 @@ proc genClosure(p: BProc, n: PNode, d: var TLoc) = assert n.kind == nkClosure if isConstClosure(n): - inc(p.labels) - var tmp = "LOC" & rope(p.labels) + inc(p.module.labels) + var tmp = "LOC" & rope(p.module.labels) addf(p.module.s[cfsData], "NIM_CONST $1 $2 = $3;$n", [getTypeDesc(p.module, n.typ), tmp, genConstExpr(p, n)]) putIntoDest(p, d, n.typ, tmp, OnStatic)