summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-01-16 09:32:01 (GMT)
committerGitHub <noreply@github.com>2024-01-16 09:32:01 (GMT)
commit17b73ab99ef12f89d41acec7500a244e68b1aaa4 (patch)
treebcde8fca4dc4dae4f9ed5369a4ea23bb825f15bb /Python/ast.c
parent6c502ba809ff662a5eebf8c6778dec6bd28918fb (diff)
downloadcpython-17b73ab99ef12f89d41acec7500a244e68b1aaa4.zip
cpython-17b73ab99ef12f89d41acec7500a244e68b1aaa4.tar.gz
cpython-17b73ab99ef12f89d41acec7500a244e68b1aaa4.tar.bz2
GH-113655: Lower the C recursion limit on various platforms (GH-113944)
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 5f46d41..71b09d8 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -1037,10 +1037,6 @@ validate_type_params(struct validator *state, asdl_type_param_seq *tps)
return 1;
}
-
-/* See comments in symtable.c. */
-#define COMPILER_STACK_FRAME_SCALE 2
-
int
_PyAST_Validate(mod_ty mod)
{
@@ -1057,9 +1053,9 @@ _PyAST_Validate(mod_ty mod)
}
/* Be careful here to prevent overflow. */
int recursion_depth = Py_C_RECURSION_LIMIT - tstate->c_recursion_remaining;
- starting_recursion_depth = recursion_depth * COMPILER_STACK_FRAME_SCALE;
+ starting_recursion_depth = recursion_depth;
state.recursion_depth = starting_recursion_depth;
- state.recursion_limit = Py_C_RECURSION_LIMIT * COMPILER_STACK_FRAME_SCALE;
+ state.recursion_limit = Py_C_RECURSION_LIMIT;
switch (mod->kind) {
case Module_kind: