Small problem in cse

Christian Iseli chris@lslsun.epfl.ch
Fri Oct 17 13:44:00 GMT 1997


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))





More information about the Gcc mailing list