bugfix: code gen for constant sequences

This commit is contained in:
Araq 2011-11-02 19:47:33 +01:00
commit 64e74cf484

View file

@ -1874,8 +1874,13 @@ proc genConstSimpleList(p: BProc, n: PNode): PRope =
proc genConstSeq(p: BProc, n: PNode, t: PType): PRope = proc genConstSeq(p: BProc, n: PNode, t: PType): PRope =
var data = ropef("{{$1, $1}", n.len.toRope) var data = ropef("{{$1, $1}", n.len.toRope)
for i in countup(0, n.len - 1): if n.len > 0:
appf(data, ",$1$n", [genConstExpr(p, n.sons[i])]) # array part needs extra curlies:
data.app(", {")
for i in countup(0, n.len - 1):
if i > 0: data.appf(",$n")
data.app genConstExpr(p, n.sons[i])
data.app("}")
data.app("}") data.app("}")
inc(gBackendId) inc(gBackendId)