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]

[old abi] name mangling would crash on g++.bugs/900325_01.C


The problem is that flush_repeats() isn't error-mark-safe.  It calls
old_backref_index(), that calls is_back_referenceable_type(), that
hands the type to TYPE_FOR_JAVA, that triggers a tree checking error.
If tree checking is disabled, we end up dying in
process_overload_item(), when calling TYPE_MAIN_VARIANT for
error_mark_node.

Even though this only affects the old ABI, and the problem doesn't
occur with the new ABI, may I go ahead and check it in?

Index: gcc/cp/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* method.c (build_mangled_name) [old abi]: Protect flush_repeats()
	from error_mark_node.

Index: gcc/cp/method.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/method.c,v
retrieving revision 1.187
diff -u -p -r1.187 method.c
--- gcc/cp/method.c 2001/01/29 18:57:22 1.187
+++ gcc/cp/method.c 2001/02/04 14:26:02
@@ -1213,6 +1213,16 @@ build_mangled_name (parmtypes, begin, en
 	      nrepeats = 0;
 	    }
 	  
+	  /* Insead of protecting flush_repeats() against
+	     error_mark_node, we can do it here.  Since we wouldn't
+	     add anything for an ERROR_MARK anyway, it's ok to skip
+	     the mangling for this type.  */
+	  if (old_style_repeats && parmtype == error_mark_node)
+	    {
+	      last_type = NULL_TREE;
+	      continue;
+	    }
+
 	  last_type = parmtype;
 
 	  /* Note that for bug-compatibility with 2.7.2, we can't build up

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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