Skip to content

Conversation

@stephentoub
Copy link
Member

If the body of negative lookaround inside of a loop and containing a capture ends up successfully matching (which means the negative lookaround fails to match), it ends up erroneously leaving a position on the backtracking stack. This fix ensures that state is popped.

This snuck in while outerloop tests weren't reporting failures (fixed recently). Upon re-enabling the test, the problem was also flagged by diagnostics added in #98472.

If the body of negative lookaround inside of a loop and containing a capture ends up successfully matching (which means the negative lookaround fails to match), it ends up erroneously leaving a position on the backtracking stack. This fix ensures that state is popped.
@danmoseley
Copy link
Member

danmoseley commented Mar 11, 2024

the test that found this -- should it be / is it possible to make it inner loop?

edit: oh, I see the test. is it possible to make a test for this specific case that's inner loop?

Copy link
Member

@danmoseley danmoseley left a comment

Choose a reason for hiding this comment

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

is interpreter unaffected?

@stephentoub
Copy link
Member Author

is interpreter unaffected?

Yes

is it possible to make a test for this specific case that's inner loop?

Sure, added.

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