mirror of
https://github.com/python/cpython.git
synced 2025-09-10 10:47:34 +00:00
add a AST validator (closes #12575)
This commit is contained in:
parent
450bb594c8
commit
832bfe2ebd
5 changed files with 897 additions and 6 deletions
|
@ -604,6 +604,10 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
PyArena_Free(arena);
|
||||
goto error;
|
||||
}
|
||||
if (!PyAST_Validate(mod)) {
|
||||
PyArena_Free(arena);
|
||||
goto error;
|
||||
}
|
||||
result = (PyObject*)PyAST_CompileEx(mod, filename,
|
||||
&cf, optimize, arena);
|
||||
PyArena_Free(arena);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue