public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applied] ir: Fix canonical type propagation cancelling
Date: Wed, 08 Sep 2021 16:24:15 +0200	[thread overview]
Message-ID: <87bl53f8mo.fsf@redhat.com> (raw)

Hello,

During the canonical type propagation optimization, when the
comparison of two type sub-objects fails, we need to cancel the
(potential) propagation of the canonical type of the current type
sub-object being compared.

We were not doing that in return_comparison_result, but were expecting
it.  Oops.

Fixed thus.

This helps to fix bug https://bugzilla.redhat.com/show_bug.cgi?id=1951501.

	* src/abg-ir.cc (return_comparison_result): When the comparison of
	the current type sub-object fails, clear the potentially
	propagated canonical type and remove it from the set of types with
	non confirmed propagated canonical types.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.

---
 src/abg-ir.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index a12a6955..3ce49e76 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -1005,12 +1005,12 @@ return_comparison_result(T& l, T& r, bool value)
 	    {
 	      // The right-hand-side operand cannot carry any tentative
 	      // canonical type at this point.
-	      type_base* canonical_type = r.get_naked_canonical_type();
-	      ABG_ASSERT(canonical_type == nullptr);
+	      is_type(&r)->priv_->clear_propagated_canonical_type();
 	      // Reset the marking of the right-hand-side operand as it no
 	      // longer carries a tentative canonical type that might be
 	      // later cancelled.
 	      is_type(&r)->priv_->set_does_not_depend_on_recursive_type();
+	      env->priv_->remove_from_types_with_non_confirmed_propagated_ct(&r);
 	    }
 	}
     }
-- 
2.30.0


-- 
		Dodji


                 reply	other threads:[~2021-09-08 14:24 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=87bl53f8mo.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).