Skip to content

Commit 49207a5

Browse files
authored
gh-140222: Increase stack margin on debug build (#142452)
Increase _PyOS_MIN_STACK_SIZE if Python is built in debug mode.
1 parent bcb6cbd commit 49207a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Include/internal/pycore_pythonrun.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ extern PyObject * _Py_CompileStringObjectWithModule(
4444
* no two calls to check recursion depth are more than this far
4545
* apart. In practice, that means it must be larger than the C
4646
* stack consumption of PyEval_EvalDefault */
47-
#if defined(_Py_ADDRESS_SANITIZER) || defined(_Py_THREAD_SANITIZER)
48-
# define _PyOS_LOG2_STACK_MARGIN 12
49-
#elif defined(Py_DEBUG) && defined(WIN32)
47+
#if (defined(Py_DEBUG) \
48+
|| defined(_Py_ADDRESS_SANITIZER) \
49+
|| defined(_Py_THREAD_SANITIZER))
5050
# define _PyOS_LOG2_STACK_MARGIN 12
5151
#else
5252
# define _PyOS_LOG2_STACK_MARGIN 11

0 commit comments

Comments
 (0)