8000 GH-91079: Decouple C stack overflow checks from Python recursion checks. by markshannon · Pull Request #96507 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-91079: Decouple C stack overflow checks from Python recursion checks. #96507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix formatting.
  • Loading branch information
markshannon committed Sep 2, 2022
commit 388d01d02aad430ee3cf09c9432b2cd2fc76594a
8 changes: 4 additions & 4 deletions Python/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ validate_constant(PyObject *value)
return 1;

if (PyTuple_CheckExact(value) || PyFrozenSet_CheckExact(value)) {
if (_Py_EnterRecursiveCall("during compilation")) {
if (_Py_EnterRecursiveCall(" during compilation")) {
return 0;
}

Expand Down Expand Up @@ -203,7 +203,7 @@ validate_expr(expr_ty exp, expr_context_ty ctx)
VALIDATE_POSITIONS(exp);
int ret = -1;

if (_Py_EnterRecursiveCall("during compilation")) {
if (_Py_EnterRecursiveCall(" during compilation")) {
return 0;
}
int check_ctx = 1;
Expand Down Expand Up @@ -524,7 +524,7 @@ validate_pattern(pattern_ty p, int star_ok)
{
VALIDATE_POSITIONS(p);
int ret = -1;
if (_Py_EnterRecursiveCall("during compilation")) {
if (_Py_EnterRecursiveCall(" during compilation")) {
return 0;
}
switch (p->kind) {
Expand Down Expand Up @@ -693,7 +693,7 @@ validate_stmt(stmt_ty stmt)
VALIDATE_POSITIONS(stmt);
int ret = -1;
Py_ssize_t i;
if (_Py_EnterRecursiveCall("during compilation")) {
if (_Py_EnterRecursiveCall(" during compilation")) {
return 0;
}
switch (stmt->kind) {
Expand Down
6 changes: 3 additions & 3 deletions Python/ast_opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ astfold_mod(mod_ty node_, PyArena *ctx_, _PyASTOptimizeState *state)
static int
astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state)
{
if (_Py_EnterRecursiveCall("during compilation")) {
if (_Py_EnterRecursiveCall(" during compilation")) {
return 0;
}
switch (node_->kind) {
Expand Down Expand Up @@ -867,7 +867,7 @@ astfold_arg(arg_ty node_, PyArena *ctx_, _PyASTOptimizeState *state)
static int
astfold_stmt(stmt_ty node_, PyArena *ctx_, _PyASTOptimizeState *state)
{
if (_Py_EnterRecursiveCall("during compilation")) {
if (_Py_EnterRecursiveCall(" during compilation")) {
return 0;
}
switch (node_->kind) {
Expand Down Expand Up @@ -1017,7 +1017,7 @@ astfold_pattern(pattern_ty node_, PyArena *ctx_, _PyASTOptimizeState *state)
// Currently, this is really only used to form complex/negative numeric
// constants in MatchValue and MatchMapping nodes
// We still recurse into all subexpressions and subpatterns anyway
if (_Py_EnterRecursiveCall("during compilation")) {
if (_Py_EnterRecursiveCall(" during compilation")) {
return 0;
}
switch (node_->kind) {
Expand Down
6 changes: 3 additions & 3 deletions Python/symtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ symtable_record_directive(struct symtable *st, identifier name, int lineno,
static int
symtable_visit_stmt(struct symtable *st, stmt_ty s)
{
if (_Py_EnterRecursiveCall("during compilation")) {
if (_Py_EnterRecursiveCall(" during compilation")) {
return 0;
}
switch (s->kind) {
Expand Down Expand Up @@ -1548,7 +1548,7 @@ symtable_handle_namedexpr(struct symtable *st, expr_ty e)
static int
symtable_visit_expr(struct symtable *st, expr_ty e)
{
if (_Py_EnterRecursiveCall("during compilation")) {
if (_Py_EnterRecursiveCall(" during compilation")) {
return 0;
}
switch (e->kind) {
Expand Down Expand Up @@ -1706,7 +1706,7 @@ symtable_visit_expr(struct symtable *st, expr_ty e)
static int
symtable_visit_pattern(struct symtable *st, pattern_ty p)
{
if (_Py_EnterRecursiveCall("during compilation")) {
if (_Py_EnterRecursiveCall(" during compilation")) {
return 0;
}
switch (p->kind) {
Expand Down
0