summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-08-24 18:59:45 +0800
committerGitHub <noreply@github.com>2023-08-24 12:59:45 +0200
commitc56a712e7d54485b97df3b110ef148f5c12f2ab3 (patch)
treefe540673374581c56aeb7108cfed50c4c5b6b010
parent53d43e96716539d96e6a1e5f3926a3fe3a11e2dd (diff)
downloadNim-c56a712e7d54485b97df3b110ef148f5c12f2ab3.tar.gz
fixes #22541; peg matchLen can raise an unlisted exception: Exception (#22545)
The `mopProc` is a recursive function.
-rw-r--r--lib/pure/pegs.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim
index 7f0f532fe..18e26027f 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