public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, applied] comparison: Fix index error when interpreting scope comparison
@ 2023-04-26 12:22 Dodji Seketeli
  0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2023-04-26 12:22 UTC (permalink / raw)
  To: libabigail

Hello,

While looking at something else, I noticed a thinko in the
code in scope_diff::ensure_lookup_tables_populated that interprets the
result of the diffing algorithm on the decls of a given scope.  Fixed
thus.

	* src/abg-comparison.cc
	(scope_diff::ensure_lookup_tables_populated): Use the proper index
	to address the deleted decl.  Also, use the range-based for syntax
	in the enclosing for-loop for more clarity.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-comparison.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc
index 59530a8a..9c580da2 100644
--- a/src/abg-comparison.cc
+++ b/src/abg-comparison.cc
@@ -6522,10 +6522,9 @@ scope_diff::ensure_lookup_tables_populated()
   edit_script& e = priv_->member_changes_;
 
   // Populate deleted types & decls lookup tables.
-  for (vector<deletion>::const_iterator i = e.deletions().begin();
-       i != e.deletions().end();
-       ++i)
+  for (const auto& deletion : e.deletions())
     {
+      unsigned i = deletion.index();
       decl_base_sptr decl = deleted_member_at(i);
       string qname = decl->get_qualified_name();
       if (is_type(decl))
-- 
2.39.1


-- 
		Dodji


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-26 12:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-26 12:22 [PATCH, applied] comparison: Fix index error when interpreting scope comparison Dodji Seketeli

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).