[Python-checkins] python/dist/src/Python marshal.c,1.72,1.73

theller@users.sourceforge.net theller@users.sourceforge.net
Tue, 30 Jul 2002 04:40:59 -0700


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

Modified Files:
	marshal.c 
Log Message:
Fix SF 588452: debug build crashes on marshal.dumps([128] * 1000).
See there for a description.

Added test case.

Bugfix candidate for 2.2.x, not sure about previous versions:
probably low priority, because virtually no one runs debug builds.


Index: marshal.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/marshal.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** marshal.c	14 Jun 2002 01:07:39 -0000	1.72
--- marshal.c	30 Jul 2002 11:40:57 -0000	1.73
***************
*** 85,90 ****
  w_short(int x, WFILE *p)
  {
! 	w_byte( x      & 0xff, p);
! 	w_byte((x>> 8) & 0xff, p);
  }
  
--- 85,90 ----
  w_short(int x, WFILE *p)
  {
! 	w_byte((char)( x      & 0xff), p);
! 	w_byte((char)((x>> 8) & 0xff), p);
  }
  
***************
*** 92,99 ****
  w_long(long x, WFILE *p)
  {
! 	w_byte((int)( x      & 0xff), p);
! 	w_byte((int)((x>> 8) & 0xff), p);
! 	w_byte((int)((x>>16) & 0xff), p);
! 	w_byte((int)((x>>24) & 0xff), p);
  }
  
--- 92,99 ----
  w_long(long x, WFILE *p)
  {
!  	w_byte((char)( x      & 0xff), p);
!  	w_byte((char)((x>> 8) & 0xff), p);
!  	w_byte((char)((x>>16) & 0xff), p);
!  	w_byte((char)((x>>24) & 0xff), p);
  }