This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: SEGV on template parameter friend


The attached C++ source code causes egcs-990103 to follow a null
pointer.  The below patch avoids this problem.  However, I'm not
entirely sure whether this is a real fix or just a bandaid.

Index: gcc/cp/ChangeLog
***************
*** 1,2 ****
--- 1,7 ----
+ 1999-01-06  Chip Salzenberg  <chip@perlsupport.com>
+ 
+ 	* friend.c (make_friend_class): Avoid core dump when
+ 	not-yet-defined friend type lacks TYPE_LANG_SPECIFIC().
+ 
  1998-12-23  Chip Salzenberg  <chip@perlsupport.com>
  

Index: gcc/cp/friend.c
*************** make_friend_class (type, friend_type)
*** 262,266 ****
      }
  
!   if (CLASSTYPE_TEMPLATE_SPECIALIZATION (friend_type)
        && uses_template_parms (friend_type))
      {
--- 262,267 ----
      }
  
!   if (TYPE_LANG_SPECIFIC (friend_type)
!       && CLASSTYPE_TEMPLATE_SPECIALIZATION (friend_type)
        && uses_template_parms (friend_type))
      {

-- 
Chip Salzenberg      - a.k.a. -      <chip@perlsupport.com>
      "When do you work?"   "Whenever I'm not busy."

ts.i.gz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]