Unverified Kaydet (Commit) 9e96e7b2 authored tarafından Miss Islington (bot)'s avatar Miss Islington (bot) Kaydeden (comit) GitHub

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

(cherry picked from commit aa8e51f5)
Co-authored-by: 's avatarSerhiy Storchaka <storchaka@gmail.com>
üst 7dcfd6c6
...@@ -2742,8 +2742,7 @@ compiler_import_as(struct compiler *c, identifier name, identifier asname) ...@@ -2742,8 +2742,7 @@ compiler_import_as(struct compiler *c, identifier name, identifier asname)
attr = PyUnicode_Substring(name, pos, (dot != -1) ? dot : len); attr = PyUnicode_Substring(name, pos, (dot != -1) ? dot : len);
if (!attr) if (!attr)
return 0; return 0;
ADDOP_O(c, IMPORT_FROM, attr, names); ADDOP_N(c, IMPORT_FROM, attr, names);
Py_DECREF(attr);
if (dot == -1) { if (dot == -1) {
break; break;
} }
...@@ -3207,8 +3206,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) ...@@ -3207,8 +3206,7 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
"param invalid for local variable"); "param invalid for local variable");
return 0; return 0;
} }
ADDOP_O(c, op, mangled, varnames); ADDOP_N(c, op, mangled, varnames);
Py_DECREF(mangled);
return 1; return 1;
case OP_GLOBAL: case OP_GLOBAL:
switch (ctx) { switch (ctx) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment