fix(search): reject parentheses nested deeper than 64 levels

Deep nesting overflowed the stack of the recursive Pidgin parser (around
400-700 levels), an uncatchable crash. The depth is now checked on the token
stream before parsing and reported as a syntax error. Listed in PLAN 6.2 and
USAGE.
This commit is contained in:
doyaGu committed 2026-10-03 08:12:34 -04:00
1 parent 8ae9780c0e
commit d2a5d36bd2
5 files changed
+70 -2

No files matched your search

+1
View File
@@ -221,6 +221,7 @@ These are invalid:
| Problem | Example |
|---|---|
| Unbalanced parentheses | `(tag:bug`, `tag:bug)` |
| Parentheses nested more than 64 levels deep | `((((…a…))))` with 65 `(` |
| An operator with a missing side | `bug AND`, `OR bug` |
| Consecutive operators | `a AND OR b` |
| A qualifier without a value | `tag:` |