diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-01-13 16:06:31 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-01-13 16:06:31 +0100 |
commit | 15c63b8011327c20acab5d155e0d5b0bd1e7c205 (patch) | |
tree | c7587b3fa2a882051b8f3f6a1f8af97fe60ae289 | |
parent | 9097033b4e526737b16a844768818caa09280fe7 (diff) | |
download | Nim-15c63b8011327c20acab5d155e0d5b0bd1e7c205.tar.gz |
fixes a long standing codegen bug concerning closures
-rw-r--r-- | compiler/ccgexprs.nim | 4 |
1 files 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) |