Closed
Description
As discussed here, the following invocation:
(peg/match ~(split "" (capture (to -1)))
"hello there friends")
can lead to:
- OOM (of
janet
process) on Linux - Crash (of
janet
process) on macos - Machine unresponsive (screen went black and rebooted after waiting a while) on Windows 10
In contrast, the following two invocations do not:
(peg/match ~(any (capture ""))
"hello there friends")
# =>
@[]
(peg/match ~(some (capture ""))
"hello there friends")
# =>
nil