From d46e71bea31ea56dbb2aa8049dcad8465bd9a28f 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 11683bbff9..f06965760b 100644 --- a/lib/pure/pegs.nim +++ b/lib/pure/pegs.nim @@ -562,7 +562,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 {.gcsafe.} = + 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