summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-04-01 00:29:37 +0300
committerGitHub <noreply@github.com>2018-04-01 00:29:37 +0300
commitaa8e51f5ebb2a71c76059f050de01fc3c985376a (patch)
tree5ec694a20bc99310bbf7c45431f8d926d935c01b /Python/compile.c
parent5a7092de1226a95a50f0f384eea8ddb288959249 (diff)
downloadcpython-git-aa8e51f5ebb2a71c76059f050de01fc3c985376a.tar.gz
bpo-33132: Fix more reference counting issues in the compiler. (GH-6323)
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 9d2ba7b18f..03b703deb0 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2843,8 +2843,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;
}
@@ -3294,8 +3293,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) {