mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-09 06:23:25 +00:00
* fixes #22148; std/memfiles.memSlices nesting now fails with memory safety capture violation * adds a test case
16 lines
318 B
Nim
16 lines
318 B
Nim
discard """
|
|
action: compile
|
|
"""
|
|
|
|
import std/memfiles
|
|
|
|
# bug #22148
|
|
proc make*(input: string) =
|
|
var inp = memfiles.open(input)
|
|
for line in memSlices(inp):
|
|
let lineF = MemFile(mem: line.data, size: line.size)
|
|
for word in memSlices(lineF, ','):
|
|
discard
|
|
|
|
make("") # Must call to trigger
|