summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2005-01-07 18:10:51 (GMT)
committerArmin Rigo <arigo@tunes.org>2005-01-07 18:10:51 (GMT)
commit664b43b3f4cbb7a63d5d67117e1d040a286af371 (patch)
treea571e7e885d6e89ca0dbbbc34593afaedd364e5a /Python/compile.c
parent5a9fb3c415d1204c7f2c12243ba5d46f5964dcbd (diff)
downloadcpython-664b43b3f4cbb7a63d5d67117e1d040a286af371.zip
cpython-664b43b3f4cbb7a63d5d67117e1d040a286af371.tar.gz
cpython-664b43b3f4cbb7a63d5d67117e1d040a286af371.tar.bz2
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.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 15c8436..545042f 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -468,12 +468,9 @@ fold_binops_on_constants(unsigned char *codestr, PyObject *consts)
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;
Fix bug introduced by last patch.Thiago Macieira2009-03-301-1/+1 * When parsing a cookie string the ',' character is special because it is used ...Benjamin C Meyer2009-03-302-3/+15 * Check for a redirection after setting the headers. If there is a redirection ...Benjamin C Meyer2009-03-301-2/+2 * When loading a url straight from cache call finished so the QNetworkReply::fi...Benjamin C Meyer2009-03-301-1/+3 * Improvements to follow the behavior of web servers and other browsers, specif...Benjamin C Meyer2009-03-301-3/+17 * Doc - added QHostInfo to QHostAddress' See Also line, as requested byKavindra Devi Palaraja2009-03-261-1/+1 * Fix a small mistake in recalculating the timeout in case we getThiago Macieira2009-03-251-10/+10 * Long live Qt 4.5!Lars Knoll2009-03-23