Skip to content

Commit aa8e51f

Browse files
bpo-33132: Fix more reference counting issues in the compiler. (GH-6323)
1 parent 5a7092d commit aa8e51f

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
@@ -2843,8 +2843,7 @@ compiler_import_as(struct compiler *c, identifier name, identifier asname)
28432843
attr = PyUnicode_Substring(name, pos, (dot != -1) ? dot : len);
28442844
if (!attr)
28452845
return 0;
2846-
ADDOP_O(c, IMPORT_FROM, attr, names);
2847-
Py_DECREF(attr);
2846+
ADDOP_N(c, IMPORT_FROM, attr, names);
28482847
if (dot == -1) {
28492848
break;
28502849
}
@@ -3294,8 +3293,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
32943293
"param invalid for local variable");
32953294
return 0;
32963295
}
3297-
ADDOP_O(c, op, mangled, varnames);
3298-
Py_DECREF(mangled);
3296+
ADDOP_N(c, op, mangled, varnames);
32993297
return 1;
33003298
case OP_GLOBAL:
33013299
switch (ctx) {

0 commit comments

Comments
 (0)