Message76267
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. |
|
Date |
User |
Action |
Args |
2008-11-23 12:28:26 | mark.dickinson | set | recipients:
+ mark.dickinson |
2008-11-23 12:28:26 | mark.dickinson | set | messageid: <1227443306.12.0.492255652415.issue4393@psf.upfronthosting.co.za> |
2008-11-23 12:28:25 | mark.dickinson | link | issue4393 messages |
2008-11-23 12:28:23 | mark.dickinson | create | |
|