public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Verify that head of dup-chain is not removed
Date: Wed, 01 Jan 2020 00:00:00 -0000	[thread overview]
Message-ID: <20200120155120.GA18544@delia> (raw)

Hi,

Check in verify_dups that the head of a duplicate chain has the die_removed
field set to 0, and fix resulting verification failure in split_dups.

Tested with verify_dups_p set on by default.

Committed to trunk.

Thanks,
- Tom

Verify that head of dup-chain is not removed

2020-01-20  Tom de Vries  <tdevries@suse.de>

	* dwz.c (verify_dups): Check that the head of a duplicate chain has the
	die_removed field set to 0.
	(split_dups): Make sure that the head of a duplicate chain has the
	die_removed field set to 0.

---
 dwz.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/dwz.c b/dwz.c
index 0e4148f..9702152 100644
--- a/dwz.c
+++ b/dwz.c
@@ -4413,6 +4413,7 @@ verify_dups (dw_die_ref die, bool ordered)
 
   assert (die->die_dup == NULL);
   assert (die->die_collapsed_children == 0);
+  assert (die->die_remove == 0);
 
   for (prev = die, d = prev->die_nextdup;
        d;
@@ -6517,13 +6518,14 @@ split_dups (dw_die_ref die, struct obstack *vec)
       merge_dups (def, decls);
     }
 
-  /* If some DIEs are no longer part of a duplicate chain, don't remove
-     them.  */
   for (i = 0; i < count; i++)
     {
       d = arr[i];
-      if (d->die_dup == NULL
-	  && d->die_nextdup == NULL)
+      if (d->die_dup == NULL)
+	/* If DIE is now either:
+	   - no longer part of a duplicate chain, or
+	   - head of a duplicate chain,
+	   don't remove it.  */
 	d->die_remove = 0;
     }
 

                 reply	other threads:[~2020-01-20 15:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200120155120.GA18544@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    /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).