Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 34359:d81b6173f050 legacy-trunk
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.
| author | Armin Rigo <arigo@tunes.org> |
|---|---|
| date | Fri, 07 Jan 2005 18:10:51 +0000 |
| parents | 0c326327e722 |
| children | bda933873758 |
line wrap: on
line diff
--- a/Python/compile.c Fri Jan 07 16:01:32 2005 +0000 +++ b/Python/compile.c Fri Jan 07 18:10:51 2005 +0000 @@ -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;
