Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 37679:58640983fd66 legacy-trunk
Use union to discriminate pointer types from enum/int types.
| author | Skip Montanaro <skip@pobox.com> |
|---|---|
| date | Thu, 13 Apr 2006 09:37:01 +0000 |
| parents | 8c998c760191 |
| children | fe88e01ff6de |
line wrap: on
line diff
--- a/Python/compile.c Thu Apr 13 08:52:56 2006 +0000 +++ b/Python/compile.c Thu Apr 13 09:37:01 2006 +0000 @@ -3066,10 +3066,8 @@ for (i = 1; i < n; i++) { ADDOP(c, DUP_TOP); ADDOP(c, ROT_THREE); - /* XXX We're casting a void* to cmpop_ty in the next stmt. */ ADDOP_I(c, COMPARE_OP, - cmpop((cmpop_ty)( CMPCAST asdl_seq_GET( - e->v.Compare.ops, i - 1)))); + cmpop((cmpop_ty)asdl_seq_GET_ENUM(e->v.Compare.ops, i - 1))); ADDOP_JREL(c, JUMP_IF_FALSE, cleanup); NEXT_BLOCK(c); ADDOP(c, POP_TOP); @@ -3080,8 +3078,7 @@ VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Compare.comparators, n - 1)); ADDOP_I(c, COMPARE_OP, /* XXX We're casting a void* to cmpop_ty in the next stmt. */ - cmpop((cmpop_ty)( CMPCAST asdl_seq_GET(e->v.Compare.ops, - n - 1)))); + cmpop((cmpop_ty)asdl_seq_GET_ENUM(e->v.Compare.ops, n - 1))); if (n > 1) { basicblock *end = compiler_new_block(c); if (end == NULL)
