Fix issue 134653 - #134696
Fix issue 134653#134696rcj1 wants to merge 4 commits into
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The reordered condition skips the final input character, causing matches ending at EOF to be missed.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Attempts to prevent duplicate DFA processing at finite-timeout chunk boundaries.
Changes:
- Reorders the optimized DFA boundary check.
- Adds large-input regression coverage.
| File | Description |
|---|---|
SymbolicRegexMatcher.cs |
Adjusts DFA boundary handling. |
Regex.MultipleMatches.Tests.cs |
Tests matches across timeout-check boundaries. |
|
Performance (win x64): Regex NonBacktracking Performance Results
|
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.


Fixes #134653
The optimized DFA loop transitioned on the boundary character before returning to perform a timeout check, but did not advance the input position. If the transition succeeded but the chunk boundary had been reached, the next loop processed that character a second time, which could cause subsequent matches to be missed.
Ensure that our position is incremented if and only if we have made a successful transition.
Added regression coverage for inputs containing 150,000 and 400,000 padding characters. The tests verify that both occurrences of foo are returned when using RegexOptions.NonBacktracking with a finite timeout.