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:
Nick Coghlan 2012-11-04 23:14:34 +10:00
parent 1321edaa55
commit aab9c2b2ea
7 changed files with 106 additions and 42 deletions

View file

@ -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 {