summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-08-09 21:15:04 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-08-09 21:15:04 (GMT)
commit832bfe2ebd5ecfa92031cd40c8b41835ba90487f (patch)
tree7677d685b8f7a7ca7901f2589d92753513b66e01 /Python/bltinmodule.c
parent450bb594c8be8aca2782c0a862b27d9fa79160b0 (diff)
downloadcpython-832bfe2ebd5ecfa92031cd40c8b41835ba90487f.zip
cpython-832bfe2ebd5ecfa92031cd40c8b41835ba90487f.tar.gz
cpython-832bfe2ebd5ecfa92031cd40c8b41835ba90487f.tar.bz2
add a AST validator (closes #12575)
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 152210b..94b2798 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);