Visitar URL original
Fix overaggressive CanBeMadeAtomic check for Set + Notone by stephentoub · Pull Request #33405 · dotnet/runtime · GitHub
Skip to content

Fix overaggressive CanBeMadeAtomic check for Set + Notone - #33405

Merged
stephentoub merged 1 commit into
dotnet:masterfrom
stephentoub:regexsetnotone
Mar 10, 2020
Merged

stephentoub merged 1 commit into
dotnet:masterfrom
stephentoub:regexsetnotone

Conversation

@stephentoub

Copy link
Copy Markdown
Member

We're erroneously converting a set loop to be atomic when it's followed by a notone where the notone's character is in the set. But if we for example have [ab]*[^a], we can't make the loop atomic, because the [ab]* can actually give back something (a b) that the [^a] will match. The fix is simply to delete the erroneous, overaggressive checks.

cc: @danmosemsft, @eerhardt, @pgovind

We're erroneously converting a set loop to be atomic when it's followed by a notone where the notone's character is in the set.  But if we for example have `[ab]*[^a]`, we can't make the loop atomic, because the `[ab]*` can actually give back something (a `b`) that the `[^a]` will match.  The fix is simply to delete the erroneous, overaggressive checks.
@stephentoub
stephentoub merged commit 86bef04 into dotnet:master Mar 10, 2020
@stephentoub
stephentoub deleted the regexsetnotone branch March 10, 2020 10:51

@eerhardt eerhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants