Kaydet (Commit) 664b43b3 authored tarafından Armin Rigo's avatar Armin Rigo

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.
üst 5a9fb3c4
...@@ -468,12 +468,9 @@ fold_binops_on_constants(unsigned char *codestr, PyObject *consts) ...@@ -468,12 +468,9 @@ fold_binops_on_constants(unsigned char *codestr, PyObject *consts)
newconst = PyNumber_Multiply(v, w); newconst = PyNumber_Multiply(v, w);
break; break;
case BINARY_DIVIDE: case BINARY_DIVIDE:
if (!_Py_QnewFlag) { /* XXX care is needed to fold this operation statically:
newconst = PyNumber_Divide(v, w); the result might depend on the run-time presence of the -Qnew flag */
break; return 0;
}
/* -Qnew is in effect: fall through to
BINARY_TRUE_DIVIDE */
case BINARY_TRUE_DIVIDE: case BINARY_TRUE_DIVIDE:
newconst = PyNumber_TrueDivide(v, w); newconst = PyNumber_TrueDivide(v, w);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment