[Python-checkins] python/dist/src/Python compile.c,2.338,2.339

arigo at users.sourceforge.net arigo at users.sourceforge.net
Fri Jan 7 19:10:56 CET 2005


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3790

Modified Files:
	compile.c 
Log Message:
Re-running python with/without the -Qnew flag uses incorrectly optimized
bytecodes from the previously saved .pyc files.  Fixed by disabling the static
optimization of BINARY_DIVIDE between two constants.



Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.338
retrieving revision 2.339
diff -u -d -r2.338 -r2.339
--- compile.c	2 Jan 2005 06:17:33 -0000	2.338
+++ compile.c	7 Jan 2005 18:10:51 -0000	2.339
@@ -468,12 +468,9 @@
 		newconst = PyNumber_Multiply(v, w);
 		break;
 	case BINARY_DIVIDE:
-		if (!_Py_QnewFlag) {
-			newconst = PyNumber_Divide(v, w);
-			break;
-		}
-		/* -Qnew is in effect:	fall through to
-		   BINARY_TRUE_DIVIDE */
+		/* XXX care is needed to fold this operation statically:
+		the result might depend on the run-time presence of the -Qnew flag */
+		return 0;
 	case BINARY_TRUE_DIVIDE:
 		newconst = PyNumber_TrueDivide(v, w);
 		break;



More information about the Python-checkins mailing list