]> granicus.if.org Git - python/commitdiff
Applying patch #726869 by Andrew I MacIntyre, reducing in _sre.c the
authorGustavo Niemeyer <gustavo@niemeyer.net>
Sun, 27 Apr 2003 06:58:54 +0000 (06:58 +0000)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Sun, 27 Apr 2003 06:58:54 +0000 (06:58 +0000)
recursion limit for certain setups of FreeBSD and OS/2.

Modules/_sre.c

index be6920df6875f9a526d128ecbe57124e55845a29..3f17d13c5dc4d4b33d5c8708c8707ed07027191c 100644 (file)
@@ -72,9 +72,18 @@ static char copyright[] =
 /* FIXME: maybe the limit should be 40000 / sizeof(void*) ? */
 #define USE_RECURSION_LIMIT 7500
 #else
+#if defined(__GNUC__) && (__GNUC__ > 2) && \
+    (defined(__FreeBSD__) || defined(PYOS_OS2))
+/* gcc 3.x, on FreeBSD and OS/2+EMX and at optimisation levels of
+ * -O3 (autoconf default) and -O2 (EMX port default), generates code
+ * for _sre that fails for the default recursion limit.
+ */
+#define USE_RECURSION_LIMIT 7500
+#else
 #define USE_RECURSION_LIMIT 10000
 #endif
 #endif
+#endif
 
 /* enables fast searching */
 #define USE_FAST_SEARCH