summaryrefslogtreecommitdiff
path: root/Include/symtable.h
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-11-04 23:14:34 +1000
committerNick Coghlan <ncoghlan@gmail.com>2012-11-04 23:14:34 +1000
commitaab9c2b2ead7b786947c367a9cc5d9c921b9ea99 (patch)
tree323a662a1f65b39e90d28f9f259bc937467691a7 /Include/symtable.h
parent1321edaa55a8df94e739e6ea5e9e658f2b7bfcc2 (diff)
downloadcpython-git-aab9c2b2ead7b786947c367a9cc5d9c921b9ea99.tar.gz
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/symtable.h')
-rw-r--r--Include/symtable.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/symtable.h b/Include/symtable.h
index 82f6269588..6ed3a2b06c 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 {