bpo-42609: Check recursion depth in the AST validator and optimizer (GH-23744)

This commit is contained in:
Serhiy Storchaka 2021-04-25 13:38:00 +03:00 committed by GitHub
parent b5adc8a7e5
commit face87c94e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 309 additions and 149 deletions

View file

@ -28,6 +28,9 @@ extern PyObject* _Py_Mangle(PyObject *p, PyObject *name);
typedef struct {
int optimize;
int ff_features;
int recursion_depth; /* current recursion depth */
int recursion_limit; /* recursion limit */
} _PyASTOptimizeState;
extern int _PyAST_Optimize(