This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix infinite loop in update_enumeration_type_from_children


diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 9d0ee13..d324b6d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -13247,12 +13247,16 @@ update_enumeration_type_from_children (struct
die_info *die,
       const gdb_byte *bytes;
       struct dwarf2_locexpr_baton *baton;
       const char *name;
-      if (child_die->tag != DW_TAG_enumerator)
+      if (child_die->tag != DW_TAG_enumerator) {
+	child_die = sibling_die (child_die);
 	continue;
+      }

       attr = dwarf2_attr (child_die, DW_AT_const_value, cu);
-      if (attr == NULL)
+      if (attr == NULL) {
+	child_die = sibling_die (child_die);
 	continue;
+      }

       name = dwarf2_name (child_die, cu);
       if (name == NULL)

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]