This is the mail archive of the gcc-bugs@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 for bogus freeing of decls



Jason --

  Here's a patch to make sure we don't free decls in duplicate_decls
when we shouldn't.  BTW, did you ever get a chance to look at:

  Fri Apr  3 16:19:53 1998  Mark Mitchell  <mmitchell@usa.net>

	  * pt.c (tsubst): Decrease the template-level of
	  TEMPLATE_TEMPLATE_PARMS.  Likewise for the DECL_INITIAL of a
	  TEMPLATE_PARM_INDEX.
	  (template_decl_level): New function.
	  (unify): Make sure to record unifications for template
	  parameters, even when the parameters exactly match the arguments.
	  Combine duplicated code for TEMPLATE_TEMPLATE_PARMs and
	  TEMPLATE_TYPE_PARMS.  Don't try to unify template parameters that
	  aren't from the level we're currently working on.

or:

  Sat Apr  4 11:30:05 1998  Mark Mitchell  <mmitchell@usa.net>

	  * typeck.c (comp_target_types): Handle references like pointers.
	  (comp_target_parms): Note that return code from comp_target_types
	  can be negative to indicate failure.

-- 
Mark Mitchell <mmitchell@usa.net>
http://home.earthlink.net/~mbmitchell
Consulting Services Available

Mon Apr 13 22:59:24 1998  Mark Mitchell  <mmitchell@usa.net>

	* decl.c (duplicate_decls): Be careful when freeing decls.

Index: decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.92
diff -c -p -r1.92 decl.c
*** decl.c	1998/04/13 11:13:36	1.92
--- decl.c	1998/04/14 05:53:36
*************** duplicate_decls (newdecl, olddecl)
*** 3090,3096 ****
  
        if ((char *)newdecl + ROUND (function_size)
  	  + ROUND (sizeof (struct lang_decl))
! 	  == obstack_next_free (&permanent_obstack))
  	{
  	  DECL_MAIN_VARIANT (newdecl) = olddecl;
  	  DECL_LANG_SPECIFIC (olddecl) = ol;
--- 3090,3098 ----
  
        if ((char *)newdecl + ROUND (function_size)
  	  + ROUND (sizeof (struct lang_decl))
! 	  == obstack_next_free (&permanent_obstack)
! 	  && ((char*) newdecl + ROUND (function_size) 
! 	      == (char*) DECL_LANG_SPECIFIC (newdecl)))
  	{
  	  DECL_MAIN_VARIANT (newdecl) = olddecl;
  	  DECL_LANG_SPECIFIC (olddecl) = ol;


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