Skip to content

Conversation

@muellerj2
Copy link
Contributor

Following #5828 and #5835, general stack unwinding is skipped when a regex (or an asserted pattern) matches successfully and matching does not follow the leftmost-longest rule. As a consequence, conditions based on _Failed or _Longest in the general unwinding loop have become superfluous, since they are always true. (For some opcodes, only _Failed was tested, but this was because they could not be generated in leftmost-longest mode.)

This removes all of these unnecessary conditions, replacing them by an initial assert to check that _Failed || _Longest is always true. Subsequently, we can use the same handler for _After_assert and _Do_nothing because no work is performed when backtracking over them. Similarly, the handler for _Disjunction_eval_alt_on_failure would immediately fall through to the handler of _Disjunction_eval_alt_always, so we can just fuse these two opcodes.

@muellerj2 muellerj2 requested a review from a team as a code owner December 12, 2025 22:57
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Dec 12, 2025
@StephanTLavavej StephanTLavavej added enhancement Something can be improved regex meow is a substring of homeowner labels Dec 12, 2025
@StephanTLavavej StephanTLavavej self-assigned this Dec 12, 2025
@StephanTLavavej StephanTLavavej removed their assignment Jan 5, 2026
@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews Jan 5, 2026
@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Jan 7, 2026
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved regex meow is a substring of homeowner

Projects

Status: Merging

Development

Successfully merging this pull request may close these issues.

2 participants