]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
The
authorTim Peters <tim.peters@gmail.com>
Tue, 8 Oct 2002 21:03:26 +0000 (21:03 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 8 Oct 2002 21:03:26 +0000 (21:03 +0000)
commitf8e943f193a3b34f056d7b3a79b794d3b747685f
treed1d1d11a157a3ccbf376061ac6756642a7fbde6c
parentaff84f751da7f4605cbcb33a63f9509a6e3ae659
The
        list(xrange(sys.maxint / 4))
test.  Changed 4 to 2.

The belief is that this test intended to trigger a bit of code in
listobject.c's NRESIZE macro that's looking for arithmetic overflow.  As
written, it doesn't achieve that, though, and leaves it up to the platform
realloc() as to whether it wants to allocate 2 gigabytes.  Some platforms
say "sure!", although they don't appear to mean it, and disaster ensues.

Changing 4 to 2 (just barely) manages to trigger the arithmetic overflow
test instead, leaving the platform realloc() out of it.
Lib/test/test_b1.py