]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-152026: Track mark-saving contexts with a counter (GH-153160)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 6 Jul 2026 05:22:37 +0000 (08:22 +0300)
committerGitHub <noreply@github.com>
Mon, 6 Jul 2026 05:22:37 +0000 (05:22 +0000)
commitb1756212f2bcbbf24089fe52a9dcfe8c49e9d724
treefac5c0ea53f8d990db21c8ffc199764d6f2da8f0
parentad54b91b9fa4c5d12f155bb09138dff21a2bdec3
gh-152026: Track mark-saving contexts with a counter (GH-153160)

Replace the state->repeat checks that guard mark saving and restoring
with an explicit save_marks counter maintained where repeat and
possessive contexts are entered and left.  Each push is now paired
with a pop decided by the same condition.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Modules/_sre/sre.c
Modules/_sre/sre.h
Modules/_sre/sre_lib.h