[Python-checkins] CVS: python/dist/src/Objects longobject.c,1.113,1.114

Tim Peters tim_one@users.sourceforge.net
Fri, 01 Mar 2002 20:18:07 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv9574/python/Objects

Modified Files:
	longobject.c 
Log Message:
_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.


Index: longobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -C2 -d -r1.113 -r1.114
*** longobject.c	16 Feb 2002 23:39:10 -0000	1.113
--- longobject.c	2 Mar 2002 04:18:04 -0000	1.114
***************
*** 64,68 ****
  	result = _PyLong_New(i);
  	if (result != NULL) {
! 		result->ob_size = i;
  		while (--i >= 0)
  			result->ob_digit[i] = src->ob_digit[i];
--- 64,68 ----
  	result = _PyLong_New(i);
  	if (result != NULL) {
! 		result->ob_size = src->ob_size;
  		while (--i >= 0)
  			result->ob_digit[i] = src->ob_digit[i];