fix #18627(Program segfaults with ARC when using openArray[string]) (#18713)
* fix #18627 * add testcase * rename * another * remove tyVarargs
This commit is contained in:
parent
8fa0decf6b
commit
13b9729183
2 changed files with 25 additions and 1 deletions
24
tests/arc/topenarray.nim
Normal file
24
tests/arc/topenarray.nim
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
discard """
|
||||
input: "hi"
|
||||
output: '''
|
||||
hi
|
||||
Nim
|
||||
'''
|
||||
matrix: "--gc:arc -d:useMalloc; --gc:arc"
|
||||
"""
|
||||
block: # bug 18627
|
||||
proc setPosition(params: openArray[string]) =
|
||||
for i in params.toOpenArray(0, params.len - 1):
|
||||
echo i
|
||||
|
||||
proc uciLoop() =
|
||||
let params = @[readLine(stdin)]
|
||||
setPosition(params)
|
||||
|
||||
uciLoop()
|
||||
|
||||
proc uciLoop2() =
|
||||
let params = @["Nim"]
|
||||
for i in params.toOpenArray(0, params.len - 1):
|
||||
echo i
|
||||
uciLoop2()
|
||||
Loading…
Add table
Add a link
Reference in a new issue