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

Tim Peters tim_one@users.sourceforge.net
Wed, 13 Jun 2001 13:50:10 -0700


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

Modified Files:
	longobject.c 
Log Message:
_PyLong_AsByteArray:  added assert that the input is normalized.  This is
outside the function's control, but is crucial to correct operation.


Index: longobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -C2 -r1.76 -r1.77
*** longobject.c	2001/06/13 20:45:17	1.76
--- longobject.c	2001/06/13 20:50:08	1.77
***************
*** 359,363 ****
  	}
  
! 	/* Copy over all the Python digits. */
  	j = 0;
  	accum = 0;
--- 359,367 ----
  	}
  
! 	/* Copy over all the Python digits.
! 	   It's crucial that every Python digit except for the MSD contribute
! 	   exactly SHIFT bits to the total, so first assert that the long is
! 	   normalized. */
! 	assert(ndigits == 0 || v->ob_digit[ndigits - 1] != 0);
  	j = 0;
  	accum = 0;