A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-checkins/2002-October/030074.html below:

[Python-checkins] python/dist/src/Lib/test test_b1.py,1.54,1.55

[Python-checkins] python/dist/src/Lib/test test_b1.py,1.54,1.55tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Tue, 08 Oct 2002 14:01:11 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv15803/python/Lib/test

Modified Files:
	test_b1.py 
Log Message:
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.

I'll backport this to the 2.2 branch next.


Index: test_b1.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_b1.py,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** test_b1.py	11 Sep 2002 18:32:30 -0000	1.54
--- test_b1.py	8 Oct 2002 21:01:07 -0000	1.55
***************
*** 550,554 ****
  
          #     http://sources.redhat.com/ml/newlib/2002/msg00369.html
!         list(xrange(sys.maxint / 4))
      except MemoryError:
          pass
--- 550,554 ----
  
          #     http://sources.redhat.com/ml/newlib/2002/msg00369.html
!         list(xrange(sys.maxint // 2))
      except MemoryError:
          pass





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4