]> granicus.if.org Git - python/commitdiff
bpo-33132: Fix more reference counting issues in the compiler. (GH-6323)
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 31 Mar 2018 21:29:37 +0000 (00:29 +0300)
committerGitHub <noreply@github.com>
Sat, 31 Mar 2018 21:29:37 +0000 (00:29 +0300)
Python/compile.c

index 9d2ba7b18f11fe8f00e483f67c1e35c6ba443de2..03b703deb041f3253c8b72c8bf46f5abb87f4bde 100644 (file)
@@ -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) {