* dwarf2read.c (read_func_scope, read_structure_type)
authorDaniel Jacobowitz <drow@false.org>
Wed, 8 Sep 2010 23:14:52 +0000 (23:14 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 8 Sep 2010 23:14:52 +0000 (23:14 +0000)
(read_common_block): Check for a NULL return from new_symbol.

gdb/ChangeLog
gdb/dwarf2read.c

index 71a63f0f0e244ded97532e1af2c62e44f7102931..63814faa07f54fd37e4d9e7f19a776196b75be56 100644 (file)
@@ -1,3 +1,8 @@
+2010-09-08  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * dwarf2read.c (read_func_scope, read_structure_type)
+       (read_common_block): Check for a NULL return from new_symbol.
+
 2010-09-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * dwarf2read.c (dwarf2_read_index): Return on no SEC_HAS_CONTENTS.
index 1379f72587e671f78d8e372e2ec0987887b2224b..cfe42d62333fefe0b3e23ec58326466a8f388d96 100644 (file)
@@ -5486,7 +5486,8 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
            {
              struct symbol *arg = new_symbol (child_die, NULL, cu);
 
-             VEC_safe_push (symbolp, template_args, arg);
+             if (arg != NULL)
+               VEC_safe_push (symbolp, template_args, arg);
            }
          else
            process_die (child_die, cu);
@@ -6825,7 +6826,8 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
            {
              struct symbol *arg = new_symbol (child_die, NULL, cu);
 
-             VEC_safe_push (symbolp, template_args, arg);
+             if (arg != NULL)
+               VEC_safe_push (symbolp, template_args, arg);
            }
 
          child_die = sibling_die (child_die);
@@ -7306,7 +7308,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
        {
          sym = new_symbol (child_die, NULL, cu);
          attr = dwarf2_attr (child_die, DW_AT_data_member_location, cu);
-         if (attr)
+         if (sym != NULL && attr != NULL)
            {
              CORE_ADDR byte_offset = 0;