]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Fix for part of the problem mentioned in #725149 by Greg Chapman.
authorGustavo Niemeyer <gustavo@niemeyer.net>
Sun, 27 Apr 2003 13:25:21 +0000 (13:25 +0000)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Sun, 27 Apr 2003 13:25:21 +0000 (13:25 +0000)
commit3646ab98af41f37eacf9cdc9d711327956b911f0
tree5e411ea69c62645ccfa7be2af992764c886e3932
parentc34f2555bd414254f941d0659ba9c229b96ec728
Fix for part of the problem mentioned in #725149 by Greg Chapman.

This problem is related to a wrong behavior from mark_save/restore(),
which don't restore the mark_stack_base before restoring the marks.
Greg's suggestion was to change the asserts, which happen to be
the only recursive ops that can continue the loop, but the problem would
happen to any operation with the same behavior. So, rather than
hardcoding this into asserts, I have changed mark_save/restore() to
always restore the stackbase before restoring the marks.

Both solutions should fix these two cases, presented by Greg:

>>> re.match('(a)(?:(?=(b)*)c)*', 'abb').groups()
('b', None)
>>> re.match('(a)((?!(b)*))*', 'abb').groups()
('b', None, None)

The rest of the bug and patch in #725149 must be discussed further.
Lib/test/test_re.py
Modules/_sre.c