Commit 32973fa
committed
fix(regex): a repeat count over RE_DUP_MAX is "Invalid content of \{\}"
A `\{n\}` / `\{n,m\}` count exceeding RE_DUP_MAX (0xffff) reached the interval
compiler and failed the i16 counter conversion with "Regular expression too
big". GNU rejects it earlier, while reading the number (GET_UNSIGNED_NUMBER in
regex-emacs.c), with `(invalid-regexp "Invalid content of \{\}")`. Add the
RE_DUP_MAX bound check right after parsing the bounds so an over-large count
signals the same error as GNU.
Fixes div_r5_regex_repeat_interval_edge_validation. (Counts in 32768..=65535,
which GNU compiles but neomacs's i16 counters still reject, remain a separate
counter-width follow-up: div_r6.)1 parent bd3ddd5 commit 32973fa
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2295 | 2295 | | |
2296 | 2296 | | |
2297 | 2297 | | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
2298 | 2308 | | |
2299 | 2309 | | |
2300 | 2310 | | |
| |||
0 commit comments