diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2017-12-18 13:11:51 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-12-18 13:11:51 (GMT) |
commit | 5659743b5693c9e23313a74117948294e35013f4 (patch) | |
tree | 91b198e9ae541b231e2f2236c8adf0f75712635c /Python | |
parent | 572636d42566da8eb6e85d5b8164e9ed8860a255 (diff) | |
download | cpython-5659743b5693c9e23313a74117948294e35013f4.zip cpython-5659743b5693c9e23313a74117948294e35013f4.tar.gz cpython-5659743b5693c9e23313a74117948294e35013f4.tar.bz2 |
bpo-32365: Fix a reference leak when compile __debug__. (GH-4916) (#4918)
It was introduced in bpo-27169.
(cherry picked from commit bd6ec4d79e8575df3d08f8a89ba721930032714c)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/compile.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/compile.c b/Python/compile.c index 13b4fb8..3b8f9bb 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -3032,10 +3032,6 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) PyObject *mangled; /* XXX AugStore isn't used anywhere! */ - mangled = _Py_Mangle(c->u->u_private, name); - if (!mangled) - return 0; - assert(!_PyUnicode_EqualToASCIIString(name, "None") && !_PyUnicode_EqualToASCIIString(name, "True") && !_PyUnicode_EqualToASCIIString(name, "False")); @@ -3045,6 +3041,10 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) return 1; } + mangled = _Py_Mangle(c->u->u_private, name); + if (!mangled) + return 0; + op = 0; optype = OP_NAME; scope = PyST_GetScope(c->u->u_ste, mangled); |