Commit ed02b3f3 authored by Mark Dickinson's avatar Mark Dickinson

Fix reference counts for test_long_and_overflow.

parent e31d3006
......@@ -388,6 +388,8 @@ test_long_and_overflow(PyObject *self)
return raiseTestError("test_long_and_overflow",
"overflow was not set to 0");
Py_DECREF(num);
/* a number smaller than LONG_MIN even on 64-bit platforms */
num = PyLong_FromString("-FFFFFFFFFFFFFFFFFFFFFFFF", NULL, 16);
if (num == NULL)
......@@ -406,6 +408,8 @@ test_long_and_overflow(PyObject *self)
return raiseTestError("test_long_and_overflow",
"overflow was not set to 0");
Py_DECREF(num);
num = PyLong_FromString("FF", NULL, 16);
if (num == NULL)
return NULL;
......@@ -423,6 +427,8 @@ test_long_and_overflow(PyObject *self)
return raiseTestError("test_long_and_overflow",
"overflow was set incorrectly");
Py_DECREF(num);
Py_INCREF(Py_None);
return Py_None;
}
......
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