Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Daniel Colascione <dancol@dancol.org>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: Fix infinite loop in update_enumeration_type_from_children
Date: Wed, 08 Oct 2014 05:58:00 -0000	[thread overview]
Message-ID: <CADPb22QvBYWaYMGwpUEwk5K1AbRKqQBgRGK8vrgigR2VTzifhA@mail.gmail.com> (raw)
In-Reply-To: <543300A0.50705@dancol.org>

On Mon, Oct 6, 2014 at 4:50 PM, Daniel Colascione <dancol@dancol.org> wrote:
> 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)
>

Thanks for finding this.

Changing the loop to a for loop is another way to go, and arguably preferable.


  parent reply	other threads:[~2014-10-08  5:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-06 20:50 Daniel Colascione
2014-10-07 18:07 ` Pedro Alves
2014-10-08  5:58 ` Doug Evans [this message]
2014-11-09 22:05   ` Daniel Colascione
2014-11-12 15:52     ` Doug Evans
2014-11-14  0:39       ` [COMMITTED PATCH] " Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADPb22QvBYWaYMGwpUEwk5K1AbRKqQBgRGK8vrgigR2VTzifhA@mail.gmail.com \
    --to=dje@google.com \
    --cc=dancol@dancol.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox