mirror of
https://github.com/python/cpython.git
synced 2026-03-03 19:40:51 +00:00
[3.12] gh-100061: Proper fix of the bug in the matching of possessive quantifiers (GH-102612) (#108003)
Restore the global Input Stream pointer after trying to match a sub-pattern.
.
(cherry picked from commit abd9cc52d9)
Co-authored-by: SKO <41810398+uyw4687@users.noreply.github.com>
This commit is contained in:
parent
00bfed7cba
commit
bd2ef82a50
4 changed files with 16 additions and 9 deletions
|
|
@ -1334,6 +1334,10 @@ SRE(match)(SRE_STATE* state, const SRE_CODE* pattern, int toplevel)
|
|||
MARK_POP(ctx->lastmark);
|
||||
LASTMARK_RESTORE();
|
||||
|
||||
/* Restore the global Input Stream pointer
|
||||
since it can change after jumps. */
|
||||
state->ptr = ptr;
|
||||
|
||||
/* We have sufficient matches, so exit loop. */
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue