fixes seq copying in channels for --gc:regions

This commit is contained in:
Araq
2018-06-07 21:35:41 +02:00
parent 12f929e582
commit 3c7bbfebb1

View File

@@ -116,7 +116,7 @@ proc storeAux(dest, src: pointer, mt: PNimType, t: PRawChannel,
if mode == mStore:
x[] = alloc0(t.region, seq.len *% mt.base.size +% GenericSeqSize)
else:
unsureAsgnRef(x, newObj(mt, seq.len * mt.base.size + GenericSeqSize))
unsureAsgnRef(x, newSeq(mt, seq.len))
var dst = cast[ByteAddress](cast[PPointer](dest)[])
var dstseq = cast[PGenericSeq](dst)
dstseq.len = seq.len