[Python-checkins] python/dist/src/Python newcompile.c,1.1.2.24,1.1.2.25

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Tue, 25 Mar 2003 07:25:39 -0800


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv10490/Python

Modified Files:
      Tag: ast-branch
	newcompile.c 
Log Message:
compiler_compare():  assert that at least one comparison operator exists.


Index: newcompile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v
retrieving revision 1.1.2.24
retrieving revision 1.1.2.25
diff -C2 -d -r1.1.2.24 -r1.1.2.25
*** newcompile.c	24 Mar 2003 23:44:19 -0000	1.1.2.24
--- newcompile.c	25 Mar 2003 15:25:35 -0000	1.1.2.25
***************
*** 1131,1134 ****
--- 1131,1135 ----
  	VISIT(c, expr, e->v.Compare.left);
  	n = asdl_seq_LEN(e->v.Compare.ops);
+ 	assert(n > 0);
  	if (n > 1)
  		cleanup = compiler_new_block(c);
***************
*** 1143,1151 ****
  		ADDOP(c, POP_TOP);
  	} 
! 	if (n) {
! 		VISIT(c, expr, asdl_seq_GET(e->v.Compare.comparators, n - 1));
! 		ADDOP_I(c, COMPARE_OP,
! 		       (cmpop_ty)asdl_seq_GET(e->v.Compare.ops, n - 1));
! 	}
  	if (n > 1) {
  		int end = compiler_new_block(c);
--- 1144,1150 ----
  		ADDOP(c, POP_TOP);
  	} 
! 	VISIT(c, expr, asdl_seq_GET(e->v.Compare.comparators, n - 1));
! 	ADDOP_I(c, COMPARE_OP,
! 	       (cmpop_ty)asdl_seq_GET(e->v.Compare.ops, n - 1));
  	if (n > 1) {
  		int end = compiler_new_block(c);