summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-11-04 13:14:34 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2012-11-04 13:14:34 (GMT)
commitaab9c2b2ead7b786947c367a9cc5d9c921b9ea99 (patch)
tree323a662a1f65b39e90d28f9f259bc937467691a7 /Include
parent1321edaa55a8df94e739e6ea5e9e658f2b7bfcc2 (diff)
downloadcpython-aab9c2b2ead7b786947c367a9cc5d9c921b9ea99.zip
cpython-aab9c2b2ead7b786947c367a9cc5d9c921b9ea99.tar.gz
cpython-aab9c2b2ead7b786947c367a9cc5d9c921b9ea99.tar.bz2
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.
Diffstat (limited to 'Include')
-rw-r--r--Include/symtable.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/symtable.h b/Include/symtable.h
index 82f6269..6ed3a2b 100644
--- a/Include/symtable.h
+++ b/Include/symtable.h
@@ -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 {