File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -344,8 +344,6 @@ medium_from_stwodigits(stwodigits x)
344344}
345345
346346
347- /* If a freshly-allocated int is already shared, it must
348- be a small integer, so negating it must go to PyLong_FromLong */
349347Py_LOCAL_INLINE (void )
350348_PyLong_Negate (PyLongObject * * x_p )
351349{
@@ -357,8 +355,10 @@ _PyLong_Negate(PyLongObject **x_p)
357355 return ;
358356 }
359357
360- * x_p = _PyLong_FromSTwoDigits (- medium_value (x ));
361- Py_DECREF (x );
358+ /* If a freshly-allocated int is already shared, it must
359+ be a small integer, so negating it will fit a single digit */
360+ assert (_long_is_small_int ((PyObject * )x ));
361+ * x_p = (PyLongObject * )_PyLong_FromSTwoDigits (- medium_value (x ));
362362}
363363
364364#define PYLONG_FROM_INT (UINT_TYPE , INT_TYPE , ival ) \
You can’t perform that action at this time.
0 commit comments