Staging
v0.8.1
https://github.com/python/cpython
Revision bc24eee333126a313bfe42381050a49ecbbc8bbe authored by Tim Peters on 27 July 2006, 01:14:53 UTC, committed by Tim Peters on 27 July 2006, 01:14:53 UTC
In general, C doesn't define anything about what happens when
an operation on a signed integral type overflows, and PyOS_strtol()
did several formally undefined things of that nature on signed
longs.  Some version of gcc apparently tries to exploit that now,
and PyOS_strtol() could fail to detect overflow then.

Tried to repair all that, although it seems at least as likely to me
that we'll get screwed by bad platform definitions for LONG_MIN
and/or LONG_MAX now.  For that reason, I don't recommend backporting
this.

Note that I have no box on which this makes a lick of difference --
can't really test it, except to note that it didn't break anything
on my boxes.

Silent change:  PyOS_strtol() used to return the hard-coded 0x7fffffff
in case of overflow.  Now it returns LONG_MAX.  They're the same only on
32-bit boxes (although C doesn't guarantee that either ...).
1 parent 95621b2
History
Tip revision: bc24eee333126a313bfe42381050a49ecbbc8bbe authored by Tim Peters on 27 July 2006, 01:14:53 UTC
Bug #1521947: possible bug in mystrtol.c with recent gcc.
Tip revision: bc24eee
File Mode Size
Demo
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
PCbuild8
Parser
Python
RISCOS
Tools
.hgtags -rw-r--r-- 3.1 KB
LICENSE -rw-r--r-- 13.2 KB
Makefile.pre.in -rw-r--r-- 34.2 KB
README -rw-r--r-- 53.5 KB
configure -rwxr-xr-x 622.3 KB
configure.in -rw-r--r-- 94.2 KB
install-sh -rwxr-xr-x 7.0 KB
pyconfig.h.in -rw-r--r-- 26.4 KB
setup.py -rw-r--r-- 65.4 KB

README

back to top