This commit is contained in:
Andreas Rumpf
2017-02-05 15:21:40 +01:00
parent d35c561759
commit b15e8124fe

View File

@@ -1383,7 +1383,9 @@ proc genArrayLen(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
proc genSetLengthSeq(p: BProc, e: PNode, d: var TLoc) =
var a, b: TLoc
assert(d.k == locNone)
initLocExpr(p, e.sons[1], a)
var x = e.sons[1]
if x.kind in {nkAddr, nkHiddenAddr}: x = x[0]
initLocExpr(p, x, a)
initLocExpr(p, e.sons[2], b)
let t = skipTypes(e.sons[1].typ, {tyVar})
let setLenPattern = if not p.module.compileToCpp: