Skip to content

[2.7] bpo-35859: re module, fix four bugs about capturing groups (GH-11756) #12134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed

[2.7] bpo-35859: re module, fix four bugs about capturing groups (GH-11756) #12134

wants to merge 5 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Mar 2, 2019

Fix wrong capturing groups in rare cases.

  • need to reset capturing groups in SRE_SEARCH()
  • macro MARK_PUSH(lastmark) didn't protect MARK 0 if it was the only available mark
  • jump JUMP_MIN_UNTIL_3 needs LASTMARK_SAVE() and MARK_PUSH()
  • jump JUMP_ASSERT_NOT needs LASTMARK_SAVE() and MARK_PUSH()

https://bugs.python.org/issue35859

wjssz added 5 commits March 2, 2019 08:21
Show the wrong behaviors before this fix.
need to reset capturing groups between two SRE_MATCH callings in loops
MARK_PUSH(lastmark) macro didn't protect MARK-0 if it was the only available mark.
@ghost
Copy link
Author

ghost commented Mar 19, 2019

See PR 12427

@ghost ghost closed this Mar 19, 2019
@ghost ghost deleted the 27_fix_re branch August 22, 2020 07:03
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants