-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RegexOptions.NonBacktracking fixed-length markers never triggered #65532
Comments
Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions Issue DetailsRunning our regex tests with code coverage shows this for SymbolicRegexMatcher.FindMatch:
|
@olsaarik The watchdog logic may have become something that is no longer triggered because of all the other optimizations. |
If we end up deleting it, presumably it would be sound to extend the phase 3 skipping based on whole-pattern fixed length from #65531 to also skip phase 2. That's not as comprehensive as the "watchdog" was meant to be, but it will get some of the cases, and it'd be easy. |
I did some debugging. It seems there is a change in the converter code that at some point turned this feature off, so watchdogs are not inserted although they should be inserted:
I believe the correct code should be the following where topLevel is the input parameter of the
Watchdogs were only appended after top level concatenations, but here this info is turned off, so that later on, any potential watchdog is never appended even when fixed length is clearly detected. |
@veanes Good find. This was not intended and that |
@olsaarik thanks for confirming this. I'll fix it with my next edits and also add an extra unit test I was using that should clearly trigger it, no matter what other optimizations are in place. |
The value is now being just passed along for a capture: Line 141 in 68fb7fc
but it's still not being hit: |
I was hoping this may have been addressed by #68199, but alas, it was not: |
Running our regex tests with code coverage shows this for SymbolicRegexMatcher.FindMatch:
This suggests that there's something very wrong with that logic, as we definitely have tests that should trigger it, and it should either be fixed or all the "watchdog" logic deleted.
cc: @olsaarik, @veanes
The text was updated successfully, but these errors were encountered: