This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Small problem in cse
- To: egcs at cygnus dot com
- Subject: Small problem in cse
- From: Christian Iseli <chris at lslsun dot epfl dot ch>
- Date: Fri, 17 Oct 1997 22:43:38 +0200
Hi,
I've received a segfault from cc1 due to a NULL dereference in cse.c. The
following
trivial patch cures the problem.
Christian
Fri Oct 17 12:29:48 1997 Christian Iseli <Christian.Iseli@lslsun.epfl.ch>
* cse.c (insert): check that classp->first_same_value is not NULL
before dereferencing.
*** cse.c.orig Wed Oct 1 07:46:27 1997
--- cse.c Fri Oct 17 22:30:11 1997
*************** insert (x, classp, hash, mode)
*** 1323,1329 ****
table[hash] = elt;
/* Put it into the proper value-class. */
! if (classp)
{
classp = classp->first_same_value;
if (CHEAPER (elt, classp))
--- 1323,1329 ----
table[hash] = elt;
/* Put it into the proper value-class. */
! if (classp && classp->first_same_value)
{
classp = classp->first_same_value;
if (CHEAPER (elt, classp))