Commit 77f0ed7a authored by Guido van Rossum's avatar Guido van Rossum Committed by GitHub

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
parent 44bfff2e
Fix crash in PyAST_FromNodeObject() when flags is NULL.
\ No newline at end of file
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment