summaryrefslogtreecommitdiffstats
path: root/Python/codegen.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2025-02-25 09:24:48 (GMT)
committerGitHub <noreply@github.com>2025-02-25 09:24:48 (GMT)
commit014223649c33b2febbccfa221c2ab7f18a8c0847 (patch)
tree5fb6432982ab3085d9275f20769f8fbcc581666b /Python/codegen.c
parent99088ab081279329b8362e1c24533fa0be303e6f (diff)
downloadcpython-014223649c33b2febbccfa221c2ab7f18a8c0847.zip
cpython-014223649c33b2febbccfa221c2ab7f18a8c0847.tar.gz
cpython-014223649c33b2febbccfa221c2ab7f18a8c0847.tar.bz2
GH-130396: Use computed stack limits on linux (GH-130398)
* Implement C recursion protection with limit pointers for Linux, MacOS and Windows * Remove calls to PyOS_CheckStack * Add stack protection to parser * Make tests more robust to low stacks * Improve error messages for stack overflow
Diffstat (limited to 'Python/codegen.c')
-rw-r--r--Python/codegen.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/codegen.c b/Python/codegen.c
index cd77b34..7669cc5 100644
--- a/Python/codegen.c
+++ b/Python/codegen.c
@@ -4885,6 +4885,9 @@ codegen_with(compiler *c, stmt_ty s, int pos)
static int
codegen_visit_expr(compiler *c, expr_ty e)
{
+ if (Py_EnterRecursiveCall(" during compilation")) {
+ return ERROR;
+ }
location loc = LOC(e);
switch (e->kind) {
case NamedExpr_kind: