diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-03-31 23:41:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-31 23:41:28 (GMT) |
commit | 9e96e7b24e4d3ff4dce4f24c4e469cd5460712c9 (patch) | |
tree | 1d4740698cc9e88e10ada6fb284b98d3ce2c98d9 /Python/compile.c | |
parent | 7dcfd6c66344594844d441e197174366ff9cfe4e (diff) | |
download | cpython-9e96e7b24e4d3ff4dce4f24c4e469cd5460712c9.zip cpython-9e96e7b24e4d3ff4dce4f24c4e469cd5460712c9.tar.gz cpython-9e96e7b24e4d3ff4dce4f24c4e469cd5460712c9.tar.bz2 |
bpo-33132: Fix more reference counting issues in the compiler. (GH-6323)
(cherry picked from commit aa8e51f5ebb2a71c76059f050de01fc3c985376a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Python/compile.c b/Python/compile.c index 03b4826..d4245e2 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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) { |