Skip to content

Commit 9e96e7b

Browse files
bpo-33132: Fix more reference counting issues in the compiler. (GH-6323)
(cherry picked from commit aa8e51f) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 7dcfd6c commit 9e96e7b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Python/compile.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,8 +2742,7 @@ compiler_import_as(struct compiler *c, identifier name, identifier asname)
27422742
attr = PyUnicode_Substring(name, pos, (dot != -1) ? dot : len);
27432743
if (!attr)
27442744
return 0;
2745-
ADDOP_O(c, IMPORT_FROM, attr, names);
2746-
Py_DECREF(attr);
2745+
ADDOP_N(c, IMPORT_FROM, attr, names);
27472746
if (dot == -1) {
27482747
break;
27492748
}
@@ -3207,8 +3206,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
32073206
"param invalid for local variable");
32083207
return 0;
32093208
}
3210-
ADDOP_O(c, op, mangled, varnames);
3211-
Py_DECREF(mangled);
3209+
ADDOP_N(c, op, mangled, varnames);
32123210
return 1;
32133211
case OP_GLOBAL:
32143212
switch (ctx) {

0 commit comments

Comments
 (0)