diff options
author | Mark Shannon <mark@hotpy.org> | 2020-12-02 13:30:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 13:30:55 (GMT) |
commit | 4e7a69bdb63a104587759d7784124492dcdd496e (patch) | |
tree | 5477c7077970d9100d089286b75ce2ff408ac613 /Include/internal | |
parent | 93a0ef76473683aa3ad215e11df18f7839488c4e (diff) | |
download | cpython-4e7a69bdb63a104587759d7784124492dcdd496e.zip cpython-4e7a69bdb63a104587759d7784124492dcdd496e.tar.gz cpython-4e7a69bdb63a104587759d7784124492dcdd496e.tar.bz2 |
bpo-42500: Fix recursion in or after except (GH-23568)
* Use counter, rather boolean state when handling soft overflows.
Diffstat (limited to 'Include/internal')
-rw-r--r-- | Include/internal/pycore_ceval.h | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index bbb667e..38fd681 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -92,24 +92,8 @@ static inline int _Py_EnterRecursiveCall_inline(const char *where) { #define Py_EnterRecursiveCall(where) _Py_EnterRecursiveCall_inline(where) -/* Compute the "lower-water mark" for a recursion limit. When - * Py_LeaveRecursiveCall() is called with a recursion depth below this mark, - * the overflowed flag is reset to 0. */ -static inline int _Py_RecursionLimitLowerWaterMark(int limit) { - if (limit > 200) { - return (limit - 50); - } - else { - return (3 * (limit >> 2)); - } -} - static inline void _Py_LeaveRecursiveCall(PyThreadState *tstate) { tstate->recursion_depth--; - int limit = tstate->interp->ceval.recursion_limit; - if (tstate->recursion_depth < _Py_RecursionLimitLowerWaterMark(limit)) { - tstate->overflowed = 0; - } } static inline void _Py_LeaveRecursiveCall_inline(void) { |