This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Can't compile egcs...
- To: sos at prospect dot com dot ru
- Subject: Re: Can't compile egcs...
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Thu, 16 Apr 1998 09:40:30 +0200
- CC: egcs-bugs at cygnus dot com
- References: <01BD67CF.7767E270@drs>
This is caused by a bug in cp/decl.c, where it would deallocate memory
it still needed. Please try the patch below.
Regards,
Martin
Thu Apr 16 09:36:37 1998 Martin von Loewis <loewis@informatik.hu-berlin.de>
* decl.c (duplicate_decls): Do not deallocate memory we don't own.
Index: decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.92
diff -u -r1.92 decl.c
--- decl.c 1998/04/13 11:13:36 1.92
+++ decl.c 1998/04/16 07:35:27
@@ -3088,9 +3088,14 @@
TREE_VALUE (decls) = olddecl;
}
- if ((char *)newdecl + ROUND (function_size)
- + ROUND (sizeof (struct lang_decl))
- == obstack_next_free (&permanent_obstack))
+ /* Only deallocate newdecl if lang_decl immediately
+ follows newdecl, and next_free immediately follows
+ permanent_obstack. */
+ if (((char *)newdecl + ROUND (function_size)
+ == (char*) DECL_LANG_SPECIFIC (newdecl))
+ && (((char*) DECL_LANG_SPECIFIC (newdecl)
+ + ROUND (sizeof (struct lang_decl)))
+ == obstack_next_free (&permanent_obstack)))
{
DECL_MAIN_VARIANT (newdecl) = olddecl;
DECL_LANG_SPECIFIC (olddecl) = ol;