Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/eng
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2022-08-31 05:05:56 +0300
committerGitHub <noreply@github.com>2022-08-31 05:05:56 +0300
commita0cc4eabd4f819cfdeeb2a692bf98b65c313e714 (patch)
treea2f13386eb3c4c793789907a9083db5e177c1d1d /eng
parentd1a71841aeddf905a9d381c9822329ff02bdc296 (diff)
[release/7.0] Fix two auto-atomicity Regex bugs (#74834)
* Stop coalescing some adjacent Regex atomic loops We walk concatenations in order to combine adjacent loops, e.g. `a+a+a+` becomes `a{3,}`. We also combine loops with individual items that are compatible, e.g. `a+ab` becomes `a{2,}b`. However, we're doing these operations on atomic loops as well, which is sometimes wrong. Since an atomic loop consumes as much as possible and never gives anything back, combining it with a subsequent loop will end up essentially ignoring any minimum specified in the latter loop. We thus can't combine atomic loops if the second loop has a minimum; this includes the case where the second "loop" is just an individual item. * Fix auto-atomicity handling of \w and \b We currently consider \w and \b non-overlapping, which allows a \w loop followed by a \b to be made atomic. The problem with this is that \b is zero-width, and it could be followed by something that does overlap with the \w. When matching at a location that is a word boundary, it is possible the first loop could give up something that matches the subsequent construct, and thus it can't be made atomic. (We could probably restrict this further to still allow atomicity when the first loop has a non-0 lower bound, but it doesn't appear to be worth the complication.) * Add a few more tests Co-authored-by: Stephen Toub <stoub@microsoft.com>
Diffstat (limited to 'eng')
0 files changed, 0 insertions, 0 deletions