[Python-checkins] python/dist/src/Objects listobject.c,2.128,2.129

mwh@users.sourceforge.net mwh@users.sourceforge.net
Mon, 29 Jul 2002 07:35:05 -0700


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

Modified Files:
	listobject.c 
Log Message:
Fix for

[ 587875 ] crash on deleting extended slice

The array code got simpler, always a good thing!


Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.128
retrieving revision 2.129
diff -C2 -d -r2.128 -r2.129
*** listobject.c	28 Jul 2002 16:35:57 -0000	2.128
--- listobject.c	29 Jul 2002 14:35:02 -0000	2.129
***************
*** 1781,1789 ****
  			for (cur = start, i = 0;
  			     cur < stop;
! 			     cur += step, i++)
! 			{
  				garbage[i] = PyList_GET_ITEM(self, cur);
  
! 				for (j = 0; j < step; j++) {
  					PyList_SET_ITEM(self, cur + j - i,
  						PyList_GET_ITEM(self,
--- 1781,1794 ----
  			for (cur = start, i = 0;
  			     cur < stop;
! 			     cur += step, i++) {
! 				int lim = step;
! 
  				garbage[i] = PyList_GET_ITEM(self, cur);
  
! 				if (cur + step >= self->ob_size) {
! 					lim = self->ob_size - cur - 1;
! 				}
! 
! 				for (j = 0; j < lim; j++) {
  					PyList_SET_ITEM(self, cur + j - i,
  						PyList_GET_ITEM(self,