* gdbtypes.c (copy_type_recursive): Allocate 'stored' on objfile's
authorTom Tromey <tromey@redhat.com>
Mon, 18 Aug 2008 19:41:28 +0000 (19:41 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 18 Aug 2008 19:41:28 +0000 (19:41 +0000)
obstack.

gdb/ChangeLog
gdb/gdbtypes.c

index 3e47523eea46b333eb3e20b43cbfc7ef384a434a..4ec6259157767f5da2684d3d9c4569f15e5d8985 100644 (file)
@@ -1,3 +1,8 @@
+2008-08-18  Tom Tromey  <tromey@redhat.com>
+
+       * gdbtypes.c (copy_type_recursive): Allocate 'stored' on objfile's
+       obstack.
+
 2008-08-18  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * rs6000-tdep.c (struct rs6000_framedata): Add gpr_mask, used_bl,
index 939a1dcee1e5898795306477d6f1551bcc253c56..bbacee5c688ec3348402e1a33f09a78c53d2a2b6 100644 (file)
@@ -2928,7 +2928,7 @@ copy_type_recursive (struct objfile *objfile,
 
   /* We must add the new type to the hash table immediately, in case
      we encounter this type again during a recursive call below.  */
-  stored = xmalloc (sizeof (struct type_pair));
+  stored = obstack_alloc (&objfile->objfile_obstack, sizeof (struct type_pair));
   stored->old = type;
   stored->new = new_type;
   *slot = stored;