classification
Title: sre bug: lastmark_save/restore
Type: behavior Stage: test needed
Components: Extension Modules, Regular Expressions Versions: Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: arigo, ezio.melotti
Priority: normal Keywords:

Created on 2010-06-30 21:18 by arigo, last changed 2010-07-01 08:33 by arigo.

Files
File name Uploaded Description Edit
x.py arigo, 2010-06-30 21:18 Bug case
Messages (2)
msg109019 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2010-06-30 21:18
The re module is buggy is rare cases; see attached example script.

The bug is caused by the macros LASTMARK_SAVE and LASTMARK_RESTORE which are sometimes used without the extra code that does if (state->repeat) {mark_save()/mark_restore()}.

The bug appears by mis-reporting the position of groups within a repeated match (with * or +), notably the position of some groups that matched in older repetitions but (after some backtracking) not in newer ones.
msg109034 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2010-07-01 08:33
It's pretty trivial to turn my x.py into a unit test, of course.
History
Date User Action Args
2010-07-01 08:33:59arigosetmessages: + msg109034
2010-06-30 22:03:48ezio.melottisetnosy: + ezio.melotti

type: behavior
components: + Regular Expressions
stage: test needed
2010-06-30 21:18:56arigocreate