mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -141,6 +141,11 @@ struct compiler_unit {
|
|||
The u pointer points to the current compilation unit, while units
|
||||
for enclosing blocks are stored in c_stack. The u and c_stack are
|
||||
managed by compiler_enter_scope() and compiler_exit_scope().
|
||||
|
||||
Note that we don't track recursion levels during compilation - the
|
||||
task of detecting and rejecting excessive levels of nesting is
|
||||
handled by the symbol analysis pass.
|
||||
|
||||
*/
|
||||
|
||||
struct compiler {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue