summaryrefslogtreecommitdiffstats
path: root/Modules/sre.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-16 14:54:33 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-16 14:54:33 (GMT)
commita0eb80999538febe046164bae541d3f07b899dfb (patch)
tree05b2bdfb56f6ef914c35602f5b4813f645f7abb7 /Modules/sre.h
parent293ab9728aafc86e33b268049ce598dccf56ff51 (diff)
parent70ca0210e8958d2665541ddd38fce2965075674e (diff)
downloadcpython-a0eb80999538febe046164bae541d3f07b899dfb.zip
cpython-a0eb80999538febe046164bae541d3f07b899dfb.tar.gz
cpython-a0eb80999538febe046164bae541d3f07b899dfb.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 00b52aa..1a6cd56 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