This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson
Date 2008-11-23.12:28:21
SpamBayes Score 1.0497868e-09
Marked as misclassified No
Message-id <1227443306.12.0.492255652415.issue4393@psf.upfronthosting.co.za>
In-reply-to
Content
This patch fixes 3 classes of bugs in Objects/longobject.c:

(1) declarations of a variable (usually a counter into the digits of
a PyLong) as int instead of Py_ssize_t.
(2) missing (twodigits) casts from multiplies and shifts.
(3) use of '<<' on negative values in _PyLong_AsByteArray.  This
may lead to undefined behaviour, according to the C standards.  (See C99, 
section 6.5.7, paragraph 4).

These bugs haven't manifested themselves in practice.  For (1), there's 
only a problem when dealing with huge integers (more than 2**31 digits).   
The bugs in (2) can only affect platform where the C 'int' type has fewer 
than 32 bits.  (3) could potentially conflict with future compiler 
optimizations, but doesn't seem to be a problem right now.

For these reasons I don't think these fixes should be backported to 2.5.3.
History
Date User Action Args
2008-11-23 12:28:26mark.dickinsonsetrecipients: + mark.dickinson
2008-11-23 12:28:26mark.dickinsonsetmessageid: <1227443306.12.0.492255652415.issue4393@psf.upfronthosting.co.za>
2008-11-23 12:28:25mark.dickinsonlinkissue4393 messages
2008-11-23 12:28:23mark.dickinsoncreate