dwarf2read.c (update_enumeration_type_from_children): Avoid infinite loop.
gdb/ChangeLog: * dwarf2read.c (update_enumeration_type_from_children): Avoid infinite loop.
This commit is contained in:
parent
57494d81b6
commit
60f7655a4a
2 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2014-11-13 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
|
* dwarf2read.c (update_enumeration_type_from_children): Avoid
|
||||||
|
infinite loop.
|
||||||
|
|
||||||
2014-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
|
2014-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
* NEWS (maint set target-async): Fix typo.
|
* NEWS (maint set target-async): Fix typo.
|
||||||
|
|
|
@ -13231,7 +13231,7 @@ update_enumeration_type_from_children (struct die_info *die,
|
||||||
struct dwarf2_cu *cu)
|
struct dwarf2_cu *cu)
|
||||||
{
|
{
|
||||||
struct obstack obstack;
|
struct obstack obstack;
|
||||||
struct die_info *child_die = die->child;
|
struct die_info *child_die;
|
||||||
int unsigned_enum = 1;
|
int unsigned_enum = 1;
|
||||||
int flag_enum = 1;
|
int flag_enum = 1;
|
||||||
ULONGEST mask = 0;
|
ULONGEST mask = 0;
|
||||||
|
@ -13240,13 +13240,16 @@ update_enumeration_type_from_children (struct die_info *die,
|
||||||
obstack_init (&obstack);
|
obstack_init (&obstack);
|
||||||
old_chain = make_cleanup_obstack_free (&obstack);
|
old_chain = make_cleanup_obstack_free (&obstack);
|
||||||
|
|
||||||
while (child_die != NULL && child_die->tag)
|
for (child_die = die->child;
|
||||||
|
child_die != NULL && child_die->tag;
|
||||||
|
child_die = sibling_die (child_die))
|
||||||
{
|
{
|
||||||
struct attribute *attr;
|
struct attribute *attr;
|
||||||
LONGEST value;
|
LONGEST value;
|
||||||
const gdb_byte *bytes;
|
const gdb_byte *bytes;
|
||||||
struct dwarf2_locexpr_baton *baton;
|
struct dwarf2_locexpr_baton *baton;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
if (child_die->tag != DW_TAG_enumerator)
|
if (child_die->tag != DW_TAG_enumerator)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -13274,7 +13277,6 @@ update_enumeration_type_from_children (struct die_info *die,
|
||||||
a flag type, no need to look at the rest of the enumerates. */
|
a flag type, no need to look at the rest of the enumerates. */
|
||||||
if (!unsigned_enum && !flag_enum)
|
if (!unsigned_enum && !flag_enum)
|
||||||
break;
|
break;
|
||||||
child_die = sibling_die (child_die);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unsigned_enum)
|
if (unsigned_enum)
|
||||||
|
|
Loading…
Add table
Reference in a new issue