summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-03-05 15:42:48 (GMT)
committerMichael W. Hudson <mwh@python.net>2002-03-05 15:42:48 (GMT)
commit325573ce28ba7d09fb72506fb6a39f3385bf0116 (patch)
treedf5612c942c7c4dafe4c432a4dfc6f7a4f900a9d
parentc4562a89ea7ad46d6b7ab57481e4cf214e7a7b47 (diff)
downloadcpython-325573ce28ba7d09fb72506fb6a39f3385bf0116.zip
cpython-325573ce28ba7d09fb72506fb6a39f3385bf0116.tar.gz
cpython-325573ce28ba7d09fb72506fb6a39f3385bf0116.tar.bz2
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.
-rw-r--r--Objects/longobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 5b7a00a..f3e7df7 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];
}