Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 80239:ab02cd145f56 3.3
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.
| author | Nick Coghlan <ncoghlan@gmail.com> |
|---|---|
| date | Sun, 04 Nov 2012 23:14:34 +1000 |
| parents | 2b0e4c640ec7 |
| children | ffb2fa900cb7 |
line wrap: on
line diff
--- a/Python/compile.c Sun Nov 04 11:47:05 2012 +0000 +++ b/Python/compile.c Sun Nov 04 23:14:34 2012 +1000 @@ -141,6 +141,11 @@ 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 {
