Fix Armin's bug 1333982. He found it, he didn't created it :-)

This code generated a C assertion:
        assert 1, ([s for s in x] +
                   [s for s in x])
        pass

assert was completely broken, it needed to use the proper block.
compiler_use_block() is now no longer used, so remove it.
This commit is contained in:
Neal Norwitz 2005-12-18 07:06:23 +00:00
parent 0e7a0ed335
commit 51abbc7b4a
2 changed files with 41 additions and 9 deletions

View file

@ -171,7 +171,6 @@ static int compiler_addop(struct compiler *, int);
static int compiler_addop_o(struct compiler *, int, PyObject *, PyObject *);
static int compiler_addop_i(struct compiler *, int, int);
static int compiler_addop_j(struct compiler *, int, basicblock *, int);
static void compiler_use_block(struct compiler *, basicblock *);
static basicblock *compiler_use_new_block(struct compiler *);
static int compiler_error(struct compiler *, const char *);
static int compiler_nameop(struct compiler *, identifier, expr_context_ty);
@ -1178,13 +1177,6 @@ compiler_new_block(struct compiler *c)
return b;
}
static void
compiler_use_block(struct compiler *c, basicblock *block)
{
assert (block != NULL);
c->u->u_curblock = block;
}
static basicblock *
compiler_use_new_block(struct compiler *c)
{
@ -2529,7 +2521,7 @@ compiler_assert(struct compiler *c, stmt_ty s)
else {
ADDOP_I(c, RAISE_VARARGS, 1);
}
compiler_use_block(c, end);
compiler_use_next_block(c, end);
ADDOP(c, POP_TOP);
return 1;
}