Issue #13169: The maximal repetition number in a regular expression has been

increased from 65534 to 2147483647 (on 32-bit platform) or 4294967294 (on
64-bit).
This commit is contained in:
Serhiy Storchaka 2013-02-16 16:54:33 +02:00
commit a0eb809995
7 changed files with 62 additions and 13 deletions

View file

@ -16,6 +16,11 @@
/* size of a code word (must be unsigned short or larger, and
large enough to hold a UCS4 character) */
#define SRE_CODE Py_UCS4
#if SIZEOF_SIZE_T > 4
# define SRE_MAXREPEAT (~(SRE_CODE)0)
#else
# define SRE_MAXREPEAT ((SRE_CODE)PY_SSIZE_T_MAX + 1u)
#endif
typedef struct {
PyObject_VAR_HEAD