public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Mark Wielaard <mark@klomp.org>
Cc: dwz@sourceware.org
Subject: Re: [PATCH] Don't crash on DWARF5 .debug_line table with zero files.
Date: Fri, 22 Jan 2021 13:41:52 +0100	[thread overview]
Message-ID: <20210122124152.GO4020736@tucnak> (raw)
In-Reply-To: <20210122124047.20503-1-mark@klomp.org>

On Fri, Jan 22, 2021 at 01:40:47PM +0100, Mark Wielaard wrote:
> Not having any files in a DWARF5 .debug_line table is odd, but not
> technically invalid. Normally there should be a zero file entry that
> is equal to the compile unit main file (there is no such zero entry
> for early DWARF versions and we handle no file entries fine in that
> case).
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1919243

Ok.

> ---
>  dwz.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/dwz.c b/dwz.c
> index 53b9548..28f0c4d 100644
> --- a/dwz.c
> +++ b/dwz.c
> @@ -1839,7 +1839,8 @@ read_debug_line (DSO *dso, dw_cu_ref cu, uint32_t off)
>  	}
>  
>        nfiles = read_uleb128 (ptr);
> -      nfiles--; /* We will skip the first (zero) entry.  */
> +      if (nfiles > 0)
> +       nfiles--; /* We will skip the first (zero) entry.  */
>      }
>  
>    cu->cu_nfiles = nfiles;
> -- 
> 2.18.4

	Jakub


      reply	other threads:[~2021-01-22 12:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 12:40 Mark Wielaard
2021-01-22 12:41 ` Jakub Jelinek [this message]

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=20210122124152.GO4020736@tucnak \
    --to=jakub@redhat.com \
    --cc=dwz@sourceware.org \
    --cc=mark@klomp.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).