gh-104482: Fix error handling bugs in ast.c (#104483)

This commit is contained in:
Irit Katriel 2023-05-15 21:53:55 +01:00 committed by GitHub
parent 26baa747c2
commit 8a3702f0c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 19 deletions

View file

@ -567,6 +567,7 @@ PyCodeObject *
_PyAST_Compile(mod_ty mod, PyObject *filename, PyCompilerFlags *pflags,
int optimize, PyArena *arena)
{
assert(!PyErr_Occurred());
struct compiler *c = new_compiler(mod, filename, pflags, optimize, arena);
if (c == NULL) {
return NULL;