Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-32365: Fix a reference leak when compile __debug__. (GH-4916)
It was introduced in bpo-27169.
(cherry picked from commit bd6ec4d)
  • Loading branch information
serhiy-storchaka authored and miss-islington committed Dec 18, 2017
commit 662da68ee3b05226daeff6dbaa1e0c2fda4d47e6
8 changes: 4 additions & 4 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -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);
Expand Down