@@ -346,13 +346,13 @@ _Py_ReachedRecursionLimitWithMargin(PyThreadState *tstate, int margin_count)
346346{
347347 uintptr_t here_addr = _Py_get_machine_stack_pointer ();
348348 _PyThreadStateImpl * _tstate = (_PyThreadStateImpl * )tstate ;
349- if (here_addr > _tstate -> c_stack_soft_limit + margin_count * _PYOS_STACK_MARGIN_BYTES ) {
349+ if (here_addr > _tstate -> c_stack_soft_limit + margin_count * _PyOS_STACK_MARGIN_BYTES ) {
350350 return 0 ;
351351 }
352352 if (_tstate -> c_stack_hard_limit == 0 ) {
353353 _Py_InitializeRecursionLimits (tstate );
354354 }
355- return here_addr <= _tstate -> c_stack_soft_limit + margin_count * _PYOS_STACK_MARGIN_BYTES ;
355+ return here_addr <= _tstate -> c_stack_soft_limit + margin_count * _PyOS_STACK_MARGIN_BYTES ;
356356}
357357
358358void
@@ -448,8 +448,8 @@ _Py_InitializeRecursionLimits(PyThreadState *tstate)
448448 _tstate -> c_stack_top = (uintptr_t )high ;
449449 ULONG guarantee = 0 ;
450450 SetThreadStackGuarantee (& guarantee );
451- _tstate -> c_stack_hard_limit = ((uintptr_t )low ) + guarantee + _PYOS_STACK_MARGIN_BYTES ;
452- _tstate -> c_stack_soft_limit = _tstate -> c_stack_hard_limit + _PYOS_STACK_MARGIN_BYTES ;
451+ _tstate -> c_stack_hard_limit = ((uintptr_t )low ) + guarantee + _PyOS_STACK_MARGIN_BYTES ;
452+ _tstate -> c_stack_soft_limit = _tstate -> c_stack_hard_limit + _PyOS_STACK_MARGIN_BYTES ;
453453#else
454454 uintptr_t here_addr = _Py_get_machine_stack_pointer ();
455455# if defined(HAVE_PTHREAD_GETATTR_NP ) && !defined(_AIX ) && !defined(__NetBSD__ )
@@ -469,17 +469,17 @@ _Py_InitializeRecursionLimits(PyThreadState *tstate)
469469 // Thread sanitizer crashes if we use a bit more than half the stack.
470470 _tstate -> c_stack_soft_limit = base + (stack_size / 2 );
471471#else
472- _tstate -> c_stack_soft_limit = base + _PYOS_STACK_MARGIN_BYTES * 2 ;
472+ _tstate -> c_stack_soft_limit = base + _PyOS_STACK_MARGIN_BYTES * 2 ;
473473#endif
474- _tstate -> c_stack_hard_limit = base + _PYOS_STACK_MARGIN_BYTES ;
474+ _tstate -> c_stack_hard_limit = base + _PyOS_STACK_MARGIN_BYTES ;
475475 assert (_tstate -> c_stack_soft_limit < here_addr );
476476 assert (here_addr < _tstate -> c_stack_top );
477477 return ;
478478 }
479479# endif
480480 _tstate -> c_stack_top = _Py_SIZE_ROUND_UP (here_addr , 4096 );
481481 _tstate -> c_stack_soft_limit = _tstate -> c_stack_top - Py_C_STACK_SIZE ;
482- _tstate -> c_stack_hard_limit = _tstate -> c_stack_top - (Py_C_STACK_SIZE + _PYOS_STACK_MARGIN_BYTES );
482+ _tstate -> c_stack_hard_limit = _tstate -> c_stack_top - (Py_C_STACK_SIZE + _PyOS_STACK_MARGIN_BYTES );
483483#endif
484484}
485485
0 commit comments