]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19437: Fix compiler_class(), handle compiler_lookup_arg() failure
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 5 Nov 2013 17:07:34 +0000 (18:07 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 5 Nov 2013 17:07:34 +0000 (18:07 +0100)
Python/compile.c

index 32465f71692941a929e96068fa2bfb9499a109f1..8b00211c9fd07346438395418d4660d69a7e9a20 100644 (file)
@@ -1772,6 +1772,10 @@ compiler_class(struct compiler *c, stmt_ty s)
             }
             i = compiler_lookup_arg(c->u->u_cellvars, str);
             Py_DECREF(str);
+            if (i < 0) {
+                compiler_exit_scope(c);
+                return 0;
+            }
             assert(i == 0);
             /* Return the cell where to store __class__ */
             ADDOP_I(c, LOAD_CLOSURE, i);