bpo-33132: Fix more reference counting issues in the compiler. (GH-6323)

(cherry picked from commit aa8e51f5eb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2018-03-31 16:41:28 -07:00 committed by GitHub
parent 7dcfd6c663
commit 9e96e7b24e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -2742,8 +2742,7 @@ compiler_import_as(struct compiler *c, identifier name, identifier asname)
attr = PyUnicode_Substring(name, pos, (dot != -1) ? dot : len);
if (!attr)
return 0;
ADDOP_O(c, IMPORT_FROM, attr, names);
Py_DECREF(attr);
ADDOP_N(c, IMPORT_FROM, attr, names);
if (dot == -1) {
break;
}
@ -3207,8 +3206,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
"param invalid for local variable");
return 0;
}
ADDOP_O(c, op, mangled, varnames);
Py_DECREF(mangled);
ADDOP_N(c, op, mangled, varnames);
return 1;
case OP_GLOBAL:
switch (ctx) {