A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-September/068823.html below:

[Python-Dev] Before 2.5 - More signed integer overflows

[Python-Dev] Before 2.5 - More signed integer overflows [Python-Dev] Before 2.5 - More signed integer overflows"Martin v. Löwis" martin at v.loewis.de
Mon Sep 18 08:56:26 CEST 2006
Neal Norwitz schrieb:
> I also tested the fix (see patch below) for the abs() issue and it
> seemed to work for 4.1.1 on 64-bit.  I'll apply the patch to head and
> 2.5 and a test after 2.5 is out.

Please also add it to 2.4.

> Index: Objects/intobject.c
> ===================================================================
> --- Objects/intobject.c (revision 51886)
> +++ Objects/intobject.c (working copy)
> @@ -763,7 +763,7 @@
>        register long a, x;
>        a = v->ob_ival;
>        x = -a;
> -       if (a < 0 && x < 0) {
> +       if (a < 0 && (unsigned long)x == 0-(unsigned long)x) {

Hmm. Shouldn't this drop 'x' and use 'a' instead? If a is
-sys.maxint-1, -a is already undefined.

Regards,
Martin

P.S. As for finding these problems, I would have hoped that
-ftrapv could help - unfortunately, gcc breaks with this
option (consumes incredible amounts of memory).
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4