Skip to content

Limit counted backreferences to <= 65535 - #874

Open
natecook1000 wants to merge 1 commit into
mainfrom
fix/capture-group-limit
Open

Limit counted backreferences to <= 65535#874
natecook1000 wants to merge 1 commit into
mainfrom
fix/capture-group-limit

Conversation

@natecook1000

Copy link
Copy Markdown
Member

The limit for backreferences in the instruction set is 2^16, but we don't validate that at parse time. This prevents creating a regex with a backreference larger than the limit.

The limit for backreferences in the instruction set is 2^16, but we
don't validate that at parse time. This prevents creating a regex with
a backreference larger than the limit at parse time.
@natecook1000

natecook1000 commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

Note that #873 raises the storage limit in the instruction set from 16 bits to 24, but enforcing the existing limit for backreferences is still fine.

@natecook1000

Copy link
Copy Markdown
Member Author

@swift-ci Please test Linux platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant