Commit 3e1c18ad authored by Thomas Heller's avatar Thomas Heller

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.
parent a6255238
...@@ -39,3 +39,6 @@ for base in maxint64, minint64, -maxint64, -(minint64 >> 1): ...@@ -39,3 +39,6 @@ for base in maxint64, minint64, -maxint64, -(minint64 >> 1):
base = 0 base = 0
else: else:
base >>= 1 base >>= 1
# Simple-minded check for SF 588452: Debug build crashes
marshal.dumps([128] * 1000)
...@@ -84,17 +84,17 @@ w_string(char *s, int n, WFILE *p) ...@@ -84,17 +84,17 @@ w_string(char *s, int n, WFILE *p)
static void static void
w_short(int x, WFILE *p) w_short(int x, WFILE *p)
{ {
w_byte( x & 0xff, p); w_byte((char)( x & 0xff), p);
w_byte((x>> 8) & 0xff, p); w_byte((char)((x>> 8) & 0xff), p);
} }
static void static void
w_long(long x, WFILE *p) w_long(long x, WFILE *p)
{ {
w_byte((int)( x & 0xff), p); w_byte((char)( x & 0xff), p);
w_byte((int)((x>> 8) & 0xff), p); w_byte((char)((x>> 8) & 0xff), p);
w_byte((int)((x>>16) & 0xff), p); w_byte((char)((x>>16) & 0xff), p);
w_byte((int)((x>>24) & 0xff), p); w_byte((char)((x>>24) & 0xff), p);
} }
#if SIZEOF_LONG > 4 #if SIZEOF_LONG > 4
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment