]> granicus.if.org Git - python/commitdiff
Shuffle premature decref; nuke unreachable code block.
authorTim Peters <tim.peters@gmail.com>
Fri, 23 Feb 2001 22:23:53 +0000 (22:23 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 23 Feb 2001 22:23:53 +0000 (22:23 +0000)
Fixes the "debug-build -O test_builtin.py and no test_b2.pyo" crash just
discussed on Python-Dev.

Python/compile.c

index 15895f206ca585fb485861c353fa76eb4f10df14..d5cad8723118ffc539c91e68a1961657d6b16ece 100644 (file)
@@ -2154,15 +2154,9 @@ com_test(struct compiling *c, node *n)
                        return;
                }
                symtable_exit_scope(c->c_symtable);
-               if (co == NULL) {
-                       c->c_errors++;
-                       i = 255;
-                       closure = 0;
-               } else {
-                       i = com_addconst(c, co);
-                       Py_DECREF(co);
-                       closure = com_make_closure(c, (PyCodeObject *)co);
-               }
+               i = com_addconst(c, co);
+               closure = com_make_closure(c, (PyCodeObject *)co);
+               Py_DECREF(co);
                com_addoparg(c, LOAD_CONST, i);
                com_push(c, 1);
                if (closure)