summaryrefslogtreecommitdiffstats
path: root/Parser/pegen.c
diff options
context:
space:
mode:
Diffstat (limited to 'Parser/pegen.c')
-rw-r--r--Parser/pegen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Parser/pegen.c b/Parser/pegen.c
index 827d4da..216edd8 100644
--- a/Parser/pegen.c
+++ b/Parser/pegen.c
@@ -1157,7 +1157,9 @@ _PyPegen_run_parser(Parser *p)
p->start_rule == Py_file_input ||
p->start_rule == Py_eval_input)
{
- assert(PyAST_Validate(res));
+ if (!PyAST_Validate(res)) {
+ return NULL;
+ }
}
#endif
return res;