mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #5765: Apply a hard recursion limit in the compiler
Previously, excessive nesting in expressions would blow the stack and segfault the interpreter. Now, a hard limit based on the configured recursion limit and a hardcoded scaling factor is applied.
This commit is contained in:
parent
1321edaa55
commit
aab9c2b2ea
7 changed files with 106 additions and 42 deletions
|
@ -30,6 +30,8 @@ struct symtable {
|
|||
PyObject *st_private; /* name of current class or NULL */
|
||||
PyFutureFeatures *st_future; /* module's future features that affect
|
||||
the symbol table */
|
||||
int recursion_depth; /* current recursion depth */
|
||||
int recursion_limit; /* recursion limit */
|
||||
};
|
||||
|
||||
typedef struct _symtable_entry {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue