summaryrefslogtreecommitdiffstats
path: root/Modules/sre.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-16 14:47:47 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-16 14:47:47 (GMT)
commit70ca0210e8958d2665541ddd38fce2965075674e (patch)
treef24e31538d932eebe73bdb07079096cabeb0e50a /Modules/sre.h
parentb19ed57d8d75b1183193558a9880db44b95157b3 (diff)
downloadcpython-70ca0210e8958d2665541ddd38fce2965075674e.zip
cpython-70ca0210e8958d2665541ddd38fce2965075674e.tar.gz
cpython-70ca0210e8958d2665541ddd38fce2965075674e.tar.bz2
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).
Diffstat (limited to 'Modules/sre.h')
-rw-r--r--Modules/sre.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/sre.h b/Modules/sre.h
index d389b46..6819698 100644
--- a/Modules/sre.h
+++ b/Modules/sre.h
@@ -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