From: Michael W. Hudson Date: Tue, 5 Mar 2002 15:42:48 +0000 (+0000) Subject: backport tim_one's checkin of X-Git-Tag: v2.2.1c1~110 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=325573ce28ba7d09fb72506fb6a39f3385bf0116;p=thirdparty%2FPython%2Fcpython.git backport tim_one's checkin of revision 1.114 of longobject.c _PyLong_Copy(): was creating a copy of the absolute value, but should copy the sign too. Added a test to test_descr to ensure that it does. Bugfix candidate. --- diff --git a/Objects/longobject.c b/Objects/longobject.c index 5b7a00aa9fcf..f3e7df713428 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -63,7 +63,7 @@ _PyLong_Copy(PyLongObject *src) i = -(i); result = _PyLong_New(i); if (result != NULL) { - result->ob_size = i; + result->ob_size = src->ob_size; while (--i >= 0) result->ob_digit[i] = src->ob_digit[i]; }