Skip to content

Conversation

@smowton
Copy link
Contributor

@smowton smowton commented Jan 23, 2026

These broke above about 300 characters because the regex in getADelimitedExpression contained an alternation inside a quantifier that the Java regex engine couldn't work out could never backtrack in practice, due to the mutual exclusivity of the alternatives with both one another and the suffix. Combined with its usage of the call stack for backtracking, at four frames per character that meant an overflow occurred quite quickly.

Fixed by making the quantifier possessive (*+), so it never backtracks once an iteration is satisfied.

I move the existing library tests into a subdirectory to avoid a new library test changing a wide variety of results, particularly ones that expose a ~100kb test string.

@smowton smowton requested a review from a team as a code owner January 23, 2026 15:41
Copilot AI review requested due to automatic review settings January 23, 2026 15:41
@github-actions github-actions bot added the Actions Analysis of GitHub Actions label Jan 23, 2026
igfoo
igfoo previously approved these changes Jan 23, 2026
@smowton smowton merged commit 949fc37 into github:main Jan 23, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Actions Analysis of GitHub Actions documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants