[Python-checkins] python/dist/src/Python ceval.c,2.351,2.352

mwh@users.sourceforge.net mwh@users.sourceforge.net
Thu, 27 Feb 2003 06:50:39 -0800


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv5999

Modified Files:
	ceval.c 
Log Message:
In the process of adding all the extended slice support I attempted to
change _PyEval_SliceIndex to round massively negative longs up to 
-INT_MAX, instead of 0 but botched it.  Get it right.

Thx to Armin for the report.


Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.351
retrieving revision 2.352
diff -C2 -d -r2.351 -r2.352
*** ceval.c	26 Feb 2003 18:11:50 -0000	2.351
--- ceval.c	27 Feb 2003 14:50:34 -0000	2.352
***************
*** 3615,3620 ****
  				/* It's an overflow error, so we need to
  				   check the sign of the long integer,
! 				   set the value to INT_MAX or 0, and clear
! 				   the error. */
  
  				/* Create a long integer with a value of 0 */
--- 3615,3620 ----
  				/* It's an overflow error, so we need to
  				   check the sign of the long integer,
! 				   set the value to INT_MAX or -INT_MAX, 
! 				   and clear the error. */
  
  				/* Create a long integer with a value of 0 */
***************
*** 3629,3636 ****
  				if (cmp < 0)
  					return 0;
! 				else if (cmp > 0)
  					x = INT_MAX;
  				else
! 					x = 0;
  			}
  		} else {
--- 3629,3636 ----
  				if (cmp < 0)
  					return 0;
! 				else if (cmp)
  					x = INT_MAX;
  				else
! 					x = -INT_MAX;
  			}
  		} else {