dwarf2read.c: fix latent buglet
authorPedro Alves <palves@redhat.com>
Mon, 3 Aug 2015 17:55:12 +0000 (18:55 +0100)
committerPedro Alves <palves@redhat.com>
Mon, 3 Aug 2015 17:55:12 +0000 (18:55 +0100)
cust->includes is:

struct compunit_symtab
{
...
  struct compunit_symtab **includes;

gdb/ChangeLog:
2015-08-03  Pedro Alves  <palves@redhat.com>

* dwarf2read.c (compute_compunit_symtab_includes): Use size of struct
compunit_symtab pointer.

gdb/dwarf2read.c

index 24a4022c4a7cff6877b99e20e6fc6719f1f239af..b5ffd04e08d0c19d09889d78794efca0dc04b8d0 100644 (file)
@@ -7983,7 +7983,7 @@ compute_compunit_symtab_includes (struct dwarf2_per_cu_data *per_cu)
       len = VEC_length (compunit_symtab_ptr, result_symtabs);
       cust->includes
        = obstack_alloc (&dwarf2_per_objfile->objfile->objfile_obstack,
-                        (len + 1) * sizeof (struct symtab *));
+                        (len + 1) * sizeof (struct compunit_symtab *));
       for (ix = 0;
           VEC_iterate (compunit_symtab_ptr, result_symtabs, ix,
                        compunit_symtab_iter);