summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-02-23 22:23:53 +0000
committerTim Peters <tim.peters@gmail.com>2001-02-23 22:23:53 +0000
commit32223d5ae5fe3a5481cd4dbd62ce9cd9f5008e08 (patch)
tree01ef7efdf4756fcd61f3b20b7dce20c1fe34b432 /Python/compile.c
parent8b57713a25233eb5fc777e0d34855211c66b4b9a (diff)
downloadcpython-32223d5ae5fe3a5481cd4dbd62ce9cd9f5008e08.tar.gz
Shuffle premature decref; nuke unreachable code block.
Fixes the "debug-build -O test_builtin.py and no test_b2.pyo" crash just discussed on Python-Dev.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 15895f206c..d5cad87231 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -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)