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

Bug#47528: gcc-2.95 miscompiles saml



merge 47528 49342
thanks

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

(gdb) 
100             data = BI(n)->d;
(gdb) 
102                     *data++ = ax % BASE;
(gdb) 
103                     ax /= BASE;
(gdb) 
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: