• Tim Peters's avatar
    The · cfac1d4a
    Tim Peters yazdı
            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.
    
    I'll backport this to the 2.2 branch next.
    cfac1d4a
test_b1.py 22.4 KB