From 2d529edf3eafa2284772c786fab4ddd17a181795 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Thu, 24 Aug 2023 18:59:45 +0800 Subject: [PATCH] fixes #22541; peg matchLen can raise an unlisted exception: Exception (#22545) The `mopProc` is a recursive function. (cherry picked from commit c56a712e7d54485b97df3b110ef148f5c12f2ab3) --- lib/pure/pegs.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim index a0bb58f391..811ed234a8 100644 --- a/lib/pure/pegs.nim +++ b/lib/pure/pegs.nim @@ -559,7 +559,7 @@ template matchOrParse(mopProc: untyped) = # procs. For the former, *enter* and *leave* event handler code generators # are provided which just return *discard*. - proc mopProc(s: string, p: Peg, start: int, c: var Captures): int = + proc mopProc(s: string, p: Peg, start: int, c: var Captures): int {.gcsafe, raises: [].} = proc matchBackRef(s: string, p: Peg, start: int, c: var Captures): int = # Parse handler code must run in an *of* clause of its own for each # *PegKind*, so we encapsulate the identical clause body for