Add self to write-after-approval list.
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index 63bd448293d848a161538da40a4871a5e5d8bd71..86499e2b683ce0c9b3f4bc71c442d074a3127c34 100644 (file)
@@ -1,5 +1,6 @@
 /* Support routines for manipulating internal types for GDB.
-   Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
+   Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
+   Free Software Foundation, Inc.
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
    This file is part of GDB.
@@ -82,7 +83,7 @@ struct extra
   {
     char str[128];
     int len;
-  };                           /* maximum extention is 128! FIXME */
+  };                           /* maximum extension is 128! FIXME */
 
 static void add_name (struct extra *, char *);
 static void add_mangled_type (struct extra *, struct type *);
@@ -1164,7 +1165,6 @@ check_typedef (register struct type *type)
 }
 
 /* New code added to support parsing of Cfront stabs strings */
-#include <ctype.h>
 #define INIT_EXTRA { pextras->len=0; pextras->str[0]='\0'; }
 #define ADD_EXTRA(c) { pextras->str[pextras->len++]=c; }
 
@@ -1350,9 +1350,8 @@ cfront_mangle_name (struct type *type, int i, int j)
          }
       ADD_EXTRA ('\0')
        printf ("add_mangled_type: %s\n", extras.str);  /* FIXME */
-      arm_mangled_name = malloc (strlen (mangled_name) + extras.len);
-      sprintf (arm_mangled_name, "%s%s", mangled_name, extras.str);
-      free (mangled_name);
+      xasprintf (&arm_mangled_name, "%s%s", mangled_name, extras.str);
+      xfree (mangled_name);
       mangled_name = arm_mangled_name;
     }
 }
@@ -1484,7 +1483,7 @@ check_stub_method (struct type *type, int method_id, int signature_id)
       argtypes[argcount] = NULL;       /* Ellist terminator */
     }
 
-  free (demangled_name);
+  xfree (demangled_name);
 
   f = TYPE_FN_FIELDLIST1 (type, method_id);
 
@@ -1835,7 +1834,7 @@ virtual_base_list (struct type *dclass)
   while (tmp_vbase)
     {
       tmp_vbase = tmp_vbase->next;
-      free (tmp_vbase_2);
+      xfree (tmp_vbase_2);
       tmp_vbase_2 = tmp_vbase;
     }
 
@@ -1986,6 +1985,8 @@ count_virtual_fns (struct type *dclass)
   struct type *pbc = primary_base_class (dclass);
   if (pbc)
     vfuncs = count_virtual_fns (pbc);
+  else
+    vfuncs = 0;
 
   for (fn = 0; fn < TYPE_NFN_FIELDS (dclass); fn++)
     for (oi = 0; oi < TYPE_FN_FIELDLIST_LENGTH (dclass, fn); oi++)
This page took 0.035577 seconds and 4 git commands to generate.