public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Steinar H. Gunderson" <sesse@google.com>
To: Nick Clifton <nickc@redhat.com>
Cc: binutils@sourceware.org, sesse@chromium.org
Subject: Re: [PATCH] Add a trie to map quickly from address range to compilation unit.
Date: Wed, 23 Mar 2022 23:24:20 +0100	[thread overview]
Message-ID: <YjueFJBHo9aP0Vlf@google.com> (raw)
In-Reply-To: <63191455-2374-5db9-f55e-ddf794c7d88e@redhat.com>

On Wed, Mar 23, 2022 at 02:14:31PM +0000, Nick Clifton wrote:
> This patch appears to introduce some new failures into the various testsuites.

I found the issue; I had swapped the linenumber_ptr and
discriminator_ptr in the two calls to
comp_unit_find_nearest_narrowest_line(). Fixing that makes the test
suite pass.

But I noticed something else that's probably not good in the existing
code; the “found” variable leaks out of the loop from the last iteration
(only). So if you find a match without a line number of the
second-to-last compilation unit but not in the last, found = false on
return, but if you find a similar match in the last compilation unit,
found = true.

I suppose this isn't intentional, but what is the intention? Should
there be a “found = false;” before the test on *linenumber_ptr?

/* Steinar */

  parent reply	other threads:[~2022-03-23 22:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21  9:40 Steinar H. Gunderson
2022-03-23 14:14 ` Nick Clifton
2022-03-23 15:53   ` Steinar H. Gunderson
2022-03-23 22:24   ` Steinar H. Gunderson [this message]
2022-03-24  5:22     ` Alan Modra
2022-03-24  8:01       ` Steinar H. Gunderson
2022-03-24 23:30         ` Alan Modra
2022-03-25  0:01           ` Steinar H. Gunderson
2022-03-28 10:19           ` Jan Beulich
2022-03-28 23:47             ` Alan Modra
2022-03-29  6:07               ` Jan Beulich
2022-03-31  6:21                 ` Steinar H. Gunderson
2022-04-03 11:39                   ` Alan Modra
2022-04-04  7:29                     ` Steinar H. Gunderson

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=YjueFJBHo9aP0Vlf@google.com \
    --to=sesse@google.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    --cc=sesse@chromium.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).