[Python-checkins] CVS: python/dist/src/Modules _sre.c,2.36,2.37
Trent Mick
python-dev@python.org
Wed, 16 Aug 2000 15:29:58 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv5710/Modules
Modified Files:
_sre.c
Log Message:
The sre test suite currently overruns the stack on Win64, Linux64, and Monterey
(64-bit AIX) This is because the RECURSION_LIMIT is too low. This patch lowers
to recusion limit to 7500 such that the recusion check fires before a segfault.
Fredrik suggested/approved the fix in private email, modulo sre's recusion
limit checking no being necessary when PyOS_CheckStack is implemented for
Windows.
Index: _sre.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v
retrieving revision 2.36
retrieving revision 2.37
diff -C2 -r2.36 -r2.37
*** _sre.c 2000/08/09 09:14:34 2.36
--- _sre.c 2000/08/16 22:29:55 2.37
***************
*** 59,65 ****
/* optional features */
! /* prevent run-away recursion (bad patterns on long strings) */
#if !defined(USE_STACKCHECK)
! #define USE_RECURSION_LIMIT 10000
#endif
--- 59,74 ----
/* optional features */
! /* prevent run-away recursion (bad patterns on long strings)
! Require a smaller recursion limit for a number of 64-bit platforms
! to prevent stack overflow:
! Win64 - MS_WIN64, Linux64 - __LP64__, Monterey (64-bit AIX) - _LP64
! XXX Or maybe this should be defined for all SIZEOF_VOIDP>4 platforms?
! */
#if !defined(USE_STACKCHECK)
! # if defined(MS_WIN64) || defined(__LP64__) || defined(_LP64)
! # define USE_RECURSION_LIMIT 7500
! # else
! # define USE_RECURSION_LIMIT 10000
! # endif
#endif