[Python-bugs-list] [ python-Bugs-488482 ] xrange() * large integer

noreply@sourceforge.net noreply@sourceforge.net
Mon, 03 Dec 2001 09:21:52 -0800


Bugs item #488482, was opened at 2001-12-03 09:21
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=488482&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Armin Rigo (arigo)
Assigned to: Nobody/Anonymous (nobody)
Summary: xrange() * large integer

Initial Comment:
The (admittedly deprecated) feature that allows xrange 
objects to be multiplied by an integer no longer 
detects overflow because of PyNumber_Multiply() 
returning a long integer object in recent Python 
versions:

Objects/rangeobject.c: long_mul(): we call 
PyNumber_Multiply() and bail out if the result is 
NULL, but then use PyInt_AS_LONG() without checking 
the object type. This gives unexpected results when 
PyNumber_Multiply() returns a PyLongObject.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=488482&group_id=5470