summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-02-05 15:21:40 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-02-05 15:21:40 +0100
commitb15e8124fe62dca5fb91eefadd1fd0de37de5923 (patch)
treeab1f6a3298189d1e1cd10dd17dc390c3c8decdd3
parentd35c561759d98115f75c1d06e2f42c73366d8d09 (diff)
downloadNim-b15e8124fe62dca5fb91eefadd1fd0de37de5923.tar.gz
fixes #5090
-rw-r--r--compiler/ccgexprs.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index a3144bb3c..f8b549777 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -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: