Commit c21e2d5b authored by Tim Peters's avatar Tim Peters

SF bug #496549 -Qnew and in-place division "/=".

eval_frame():  Under -Qnew, INPLACE_DIVIDE wasn't getting handed off to
INPLACE_TRUE_DIVIDE (like BINARY_DIVIDE was getting handed off to
BINARY_TRUE_DIVIDE).

Bugfix candidate.
parent c04a43ff
...@@ -1091,9 +1091,22 @@ eval_frame(PyFrameObject *f) ...@@ -1091,9 +1091,22 @@ eval_frame(PyFrameObject *f)
break; break;
case INPLACE_DIVIDE: case INPLACE_DIVIDE:
if (!_Py_QnewFlag) {
w = POP();
v = POP();
x = PyNumber_InPlaceDivide(v, w);
Py_DECREF(v);
Py_DECREF(w);
PUSH(x);
if (x != NULL) continue;
break;
}
/* -Qnew is in effect: fall through to
INPLACE_TRUE_DIVIDE */
case INPLACE_TRUE_DIVIDE:
w = POP(); w = POP();
v = POP(); v = POP();
x = PyNumber_InPlaceDivide(v, w); x = PyNumber_InPlaceTrueDivide(v, w);
Py_DECREF(v); Py_DECREF(v);
Py_DECREF(w); Py_DECREF(w);
PUSH(x); PUSH(x);
...@@ -1110,16 +1123,6 @@ eval_frame(PyFrameObject *f) ...@@ -1110,16 +1123,6 @@ eval_frame(PyFrameObject *f)
if (x != NULL) continue; if (x != NULL) continue;
break; break;
case INPLACE_TRUE_DIVIDE:
w = POP();
v = POP();
x = PyNumber_InPlaceTrueDivide(v, w);
Py_DECREF(v);
Py_DECREF(w);
PUSH(x);
if (x != NULL) continue;
break;
case INPLACE_MODULO: case INPLACE_MODULO:
w = POP(); w = POP();
v = POP(); v = POP();
......
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