mirror of https://github.com/python/cpython
long_true_divide(): decref its converted arguments. test_long_future.py
run in an infinite loop no longer grows. Thanks to Neal Norwitz for determining that test leaked!
This commit is contained in:
parent
8c5e41559c
commit
6f97e493e1
|
@ -1615,12 +1615,15 @@ long_true_divide(PyObject *v, PyObject *w)
|
||||||
{
|
{
|
||||||
PyLongObject *a, *b;
|
PyLongObject *a, *b;
|
||||||
double ad, bd;
|
double ad, bd;
|
||||||
int aexp, bexp;
|
int aexp, bexp, failed;
|
||||||
|
|
||||||
CONVERT_BINOP(v, w, &a, &b);
|
CONVERT_BINOP(v, w, &a, &b);
|
||||||
ad = _PyLong_AsScaledDouble((PyObject *)a, &aexp);
|
ad = _PyLong_AsScaledDouble((PyObject *)a, &aexp);
|
||||||
bd = _PyLong_AsScaledDouble((PyObject *)b, &bexp);
|
bd = _PyLong_AsScaledDouble((PyObject *)b, &bexp);
|
||||||
if ((ad == -1.0 || bd == -1.0) && PyErr_Occurred())
|
failed = (ad == -1.0 || bd == -1.0) && PyErr_Occurred();
|
||||||
|
Py_DECREF(a);
|
||||||
|
Py_DECREF(b);
|
||||||
|
if (failed)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (bd == 0.0) {
|
if (bd == 0.0) {
|
||||||
|
|
Loading…
Reference in New Issue