diff options
| author | Benjamin Peterson <benjamin@python.org> | 2011-08-09 16:15:04 -0500 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2011-08-09 16:15:04 -0500 |
| commit | c0be20ca52c183bdf84ec1bafe5ede1fc95e38e9 (patch) | |
| tree | 84b89d3e633d1adfd94c64c1a5cb00dd8f03513b /Python/bltinmodule.c | |
| parent | 9ff03ea586d4e297aad2c68f52334c7af25bf770 (diff) | |
| download | cpython-c0be20ca52c183bdf84ec1bafe5ede1fc95e38e9.tar.gz | |
add a AST validator (closes #12575)
Diffstat (limited to 'Python/bltinmodule.c')
| -rw-r--r-- | Python/bltinmodule.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 152210b30b..94b2798fee 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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); |
