diff options
author | Mark Shannon <mark@hotpy.org> | 2023-08-04 09:10:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-04 09:10:29 (GMT) |
commit | fa45958450aa3489607daf9855ca0474a2a20878 (patch) | |
tree | 0e7a9b21503a7cf08691b99990ee6a538aa931b5 /Python/symtable.c | |
parent | 0bd784b355edf0d1911a7830db5d41c84171e367 (diff) | |
download | cpython-fa45958450aa3489607daf9855ca0474a2a20878.zip cpython-fa45958450aa3489607daf9855ca0474a2a20878.tar.gz cpython-fa45958450aa3489607daf9855ca0474a2a20878.tar.bz2 |
GH-107263: Increase C stack limit for most functions, except `_PyEval_EvalFrameDefault()` (GH-107535)
* Set C recursion limit to 1500, set cost of eval loop to 2 frames, and compiler mutliply to 2.
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 04be319..e9adbd5 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -282,17 +282,10 @@ symtable_new(void) return NULL; } -/* When compiling the use of C stack is probably going to be a lot - lighter than when executing Python code but still can overflow - and causing a Python crash if not checked (e.g. eval("()"*300000)). - Using the current recursion limit for the compiler seems too - restrictive (it caused at least one test to fail) so a factor is - used to allow deeper recursion when compiling an expression. - - Using a scaling factor means this should automatically adjust when +/* Using a scaling factor means this should automatically adjust when the recursion limit is adjusted for small or large C stack allocations. */ -#define COMPILER_STACK_FRAME_SCALE 3 +#define COMPILER_STACK_FRAME_SCALE 2 struct symtable * _PySymtable_Build(mod_ty mod, PyObject *filename, PyFutureFeatures *future) |