* don't zero out in a move in the VM

* Add testcases for #17199

* Update tests/arc/tarcmisc.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Update tests/vm/tissues.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Fix test failures

* Fix test

* Fix tests

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
This commit is contained in:
Clyybber 2021-03-26 13:05:51 +01:00 • committed by GitHub
commit bb3769975b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 63 additions and 18 deletions

View file

@ -390,3 +390,35 @@ proc newPixelBuffer(): PixelBuffer =
discard newPixelBuffer()
# bug #17199
proc passSeq(data: seq[string]) =
# used the system.& proc initially
let wat = data & "hello"
proc test2 =
let name = @["hello", "world"]
passSeq(name)
doAssert name == @["hello", "world"]
static: test2() # was buggy
test2()
proc merge(x: sink seq[string], y: sink string): seq[string] =
newSeq(result, x.len + 1)
for i in 0..x.len-1:
result[i] = move(x[i])
result[x.len] = move(y)
proc passSeq2(data: seq[string]) =
# used the system.& proc initially
let wat = merge(data, "hello")
proc test3 =
let name = @["hello", "world"]
passSeq2(name)
doAssert name == @["hello", "world"]
static: test3() # was buggy
test3()