Skip to content

Conversation

@stephentoub
Copy link
Member

@stephentoub stephentoub commented Apr 17, 2022

When a lazy loop has completed iterations but then ends up failing, and the thing it's looping around has no backtracking constructs, we're incorrectly leaving some state associated with the loop on the backtracking stack. That matters if something earlier in the expression will backtrack and pop associated state from the stack, as it could read the lazy loop's leftover state instead of its own.

When a lazy loop has completed iterations but then ends up failing, and the thing it's looping around has no backtracking constructs, we're incorrectly leaving some state associated with the loop on the backtracking stack.
@ghost
Copy link

ghost commented Apr 17, 2022

Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.

Issue Details

When a lazy loop has completed iterations but then ends up failing, and the thing it's looping around has no backtracking constructs, we're incorrectly leaving some state associated with the loop on the backtracking stack.

Author: stephentoub
Assignees: stephentoub
Labels:

area-System.Text.RegularExpressions

Milestone: -

@stephentoub stephentoub merged commit 310eaa6 into dotnet:main Apr 18, 2022
@stephentoub stephentoub deleted the fixlazyloophandling branch April 18, 2022 22:02
directhex pushed a commit to directhex/runtime that referenced this pull request Apr 21, 2022
When a lazy loop has completed iterations but then ends up failing, and the thing it's looping around has no backtracking constructs, we're incorrectly leaving some state associated with the loop on the backtracking stack.
@ghost ghost locked as resolved and limited conversation to collaborators May 19, 2022
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.

2 participants