public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applied] dwarf-reader: compare_dies sometimes compares empty formal parms
Date: Mon, 20 Jun 2022 17:23:40 +0200	[thread overview]
Message-ID: <87sfnzgxz7.fsf@redhat.com> (raw)

Hello,

compare_dies sometimes compares uninitialized DIE structs, which leads
to junk down the road.  Fixed thus.

	* src/abg-dwarf-reader.cc (compare_dies): Don't try to compare
	formal parameters if there is none.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-dwarf-reader.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index d43364f1..5cbf3e44 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -10634,9 +10634,10 @@ compare_dies(const read_context& ctxt,
 	bool l_type_is_void = !die_die_attribute(l, DW_AT_type, l_type);
 	bool r_type_is_void = !die_die_attribute(r, DW_AT_type, r_type);
 	if ((l_type_is_void != r_type_is_void)
-	    || !compare_dies(ctxt, &l_type, &r_type,
-			     aggregates_being_compared,
-			     update_canonical_dies_on_the_fly))
+	    || (!l_type_is_void
+		&& !compare_dies(ctxt, &l_type, &r_type,
+				 aggregates_being_compared,
+				 update_canonical_dies_on_the_fly)))
 	  result = false;
       }
       break;
-- 
2.36.1


-- 
		Dodji


                 reply	other threads:[~2022-06-20 15:23 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=87sfnzgxz7.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=libabigail@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).