Don't die on TYPE_CODE_UNDEF nodes as base classes.
authorKen Raeburn <raeburn@cygnus>
Tue, 14 Jul 1992 21:33:39 +0000 (21:33 +0000)
committerKen Raeburn <raeburn@cygnus>
Tue, 14 Jul 1992 21:33:39 +0000 (21:33 +0000)
(Previous checkin died due to cvs bug.)

gdb/buildsym.c

index a3a2f875954059d34c9f723798521966ac600fbb..5e472b5dbfd62b27257183742e5fd0f2ef1a09fe 100644 (file)
@@ -2690,8 +2690,13 @@ read_struct_type (pp, type, objfile)
   {
     int i;
     for (i = 0; i < TYPE_N_BASECLASSES (type); ++i)
-      TYPE_NFN_FIELDS_TOTAL (type) +=
-       TYPE_NFN_FIELDS_TOTAL (TYPE_BASECLASS (type, i));
+      {
+       if (TYPE_CODE (TYPE_BASECLASS (type, i)) == TYPE_CODE_UNDEF)
+         /* @@ Memory leak on objfile->type_obstack?  */
+         return error_type (pp);
+       TYPE_NFN_FIELDS_TOTAL (type) +=
+         TYPE_NFN_FIELDS_TOTAL (TYPE_BASECLASS (type, i));
+      }
   }
 
   for (n = nfn_fields; mainlist; mainlist = mainlist->next) {