[issue35091] Objects/listobject.c: gallop functions rely on signed integer overflow
Tim Peters
report at bugs.python.org
Sun Oct 28 20:13:44 EDT 2018
Tim Peters <tim at python.org> added the comment:
I left the code in because it was harmless (a 100%-predictable branch), and it was easier to show that overflow was _considered_ than to explain in full why it was impossible. In the context of CPython. For example, the Java port of this code couldn't rely on the far-removed-from-this-code details of Python's C heap management (the largest Java signed integer is a legit Java array index), and signed integer overflow _is_ wholly defined in Java. Which happens to be the same way it worked under virtually all C compilers at the time the code was written. The idea that C compilers should be as aggressive as Fortran compilers instead of just supplying a portable assembly language is a modern conceit ;-)
The code is useless, but it's not "a bug", so I'm removing Python 2 from the list of targets.
----------
versions: -Python 2.7
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35091>
_______________________________________
More information about the Python-bugs-list
mailing list