diff options
author | Guido van Rossum <guido@python.org> | 2019-05-28 23:44:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-28 23:44:58 (GMT) |
commit | 77f0ed7a42606d03ebfe48ab152caf0d796d6540 (patch) | |
tree | 1aab5bc929a5d50b3a4820ce7fdb2c05aafd6a73 /Python/ast.c | |
parent | 44bfff2ec220f2e0291150a776d4d77af7c821ef (diff) | |
download | cpython-77f0ed7a42606d03ebfe48ab152caf0d796d6540.zip cpython-77f0ed7a42606d03ebfe48ab152caf0d796d6540.tar.gz cpython-77f0ed7a42606d03ebfe48ab152caf0d796d6540.tar.bz2 |
bpo-37072: Fix crash in PyAST_FromNodeObject() when flags is NULL (#13634)
I'm confident that this fixes the reported crash. flags=NULL is treated as using the latest minor version.
https://bugs.python.org/issue37072
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/ast.c b/Python/ast.c index 7ffdf4a..12a45f9 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -786,7 +786,7 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags, /* borrowed reference */ c.c_filename = filename; c.c_normalize = NULL; - c.c_feature_version = flags->cf_feature_version; + c.c_feature_version = flags ? flags->cf_feature_version : PY_MINOR_VERSION; if (TYPE(n) == encoding_decl) n = CHILD(n, 0); |