[Python-checkins] r57456 - python/trunk/Python/compile.c

nick.coghlan python-checkins at python.org
Sat Aug 25 06:35:54 CEST 2007


Author: nick.coghlan
Date: Sat Aug 25 06:35:54 2007
New Revision: 57456

Modified:
   python/trunk/Python/compile.c
Log:
Revert compile.c changes that shouldn't have been included in previous checkin

Modified: python/trunk/Python/compile.c
==============================================================================
--- python/trunk/Python/compile.c	(original)
+++ python/trunk/Python/compile.c	Sat Aug 25 06:35:54 2007
@@ -1616,14 +1616,10 @@
 		orelse = NULL;
 
 	ADDOP_JREL(c, SETUP_LOOP, end);
+	compiler_use_next_block(c, loop);
 	if (!compiler_push_fblock(c, LOOP, loop))
 		return 0;
-	compiler_use_next_block(c, loop);
 	if (constant == -1) {
-		/* XXX(ncoghlan): SF bug #1750076
-		   Use same special casing as is used in for loops
-		   A test case for this would be nice... */
-		c->u->u_lineno_set = false;
 		VISIT(c, expr, s->v.While.test);
 		ADDOP_JREL(c, JUMP_IF_FALSE, anchor);
 		ADDOP(c, POP_TOP);
@@ -3525,8 +3521,7 @@
 	/* XXX(nnorwitz): is there a better way to handle this?
 	   for loops are special, we want to be able to trace them
 	   each time around, so we need to set an extra line number. */
-	/* XXX(ncoghlan): while loops need this too */
-	if (d_lineno == 0)
+	if (d_lineno == 0 && i->i_opcode != FOR_ITER)
 		return 1;
 
 	if (d_bytecode > 255) {


More information about the Python-checkins mailing list