[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#47528: gcc-2.95 miscompiles saml

merge 47528 49342

Both these segfaults happen in the same place, and are due to gcc-2.95
miscompiling lib/Integer.c:

100             data = BI(n)->d;
102                     *data++ = ax % BASE;
103                     ax /= BASE;
104             } while (ax);
(gdb) p ax
$1 = 0
(gdb) n
102                     *data++ = ax % BASE;

(It continues round the loop like this, blithely ignoring the fact that
ax is 0, and eventually segfaults when the data pointer runs off the end
of memory.)

Compiling this file with gcc-3.0 fixes the problem, so these two bugs
can be closed once the various port maintainers decide to start using
gcc-3.0 as the default C compiler on all architectures.

Colin Watson                                  [cjwatson@flatline.org.uk]

Reply to: