From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97168 invoked by alias); 20 Jan 2020 15:51:37 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 97148 invoked by uid 89); 20 Jan 2020 15:51:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=ordered X-Spam-Status: No, score=-25.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mx2.suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Date: Wed, 01 Jan 2020 00:00:00 -0000 From: Tom de Vries To: dwz@sourceware.org, jakub@redhat.com Subject: [committed] Verify that head of dup-chain is not removed Message-ID: <20200120155120.GA18544@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2020-q1/txt/msg00030.txt 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 * 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; }