From patchwork Thu Sep 7 14:03:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75455 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EF0BD3858C2D for ; Thu, 7 Sep 2023 14:04:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF0BD3858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694095446; bh=644UvUoAqtehP3B1oINUbXxpeP5DDj7kfC6GMIVKzm0=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=s/loxdzDFXJWVjFkPhe+3QJXd8P/V3zoPCwqaMlFrRpOBdUzv2L70gW/HRLd/66Xb MGRPV3InwqipL0eGP+yiOOO2uoq/aWeceGUwBgdZAw2bkE6vsexkM9oLqcLBdR9izy bULBIB1A/LFcaEjat9oBDN5u6JEI3Vfrqo2dbKfw= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 63B433858D1E for ; Thu, 7 Sep 2023 14:03:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 63B433858D1E Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-45-Ab-5M4JPNlOpdO8DCiPaKQ-1; Thu, 07 Sep 2023 10:03:57 -0400 X-MC-Unique: Ab-5M4JPNlOpdO8DCiPaKQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-649b66c99b7so11482846d6.2 for ; Thu, 07 Sep 2023 07:03:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694095436; x=1694700236; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=644UvUoAqtehP3B1oINUbXxpeP5DDj7kfC6GMIVKzm0=; b=Z57aAvi5NFiqLt1HeQkOmD8mT+TzWudjXkU5OlYRFdMUQe1ixJLDKv86orKciou5Xm o4f+j3Zhwk1q3L81wvhF3ri5IbjGNJnj0KSpdxzjjmeduaKgcyWD4dZCP/JoOG9idbKQ myG4FHtFdQ9DyKw0F2tdTGUAU+6S/GXWtmW7R/aJnYVIhN2/rX9O+RTE21+2vkjfFctI TkQBZVsO3kuq5jgC4F4We0h8VIHWYmiML2gdd6ZrExQDF15boyHp5J1jaUZA185DKh+2 HvEZosdypCKczWDj0waHhY6CmuJRRAMJKdplO6Py5JqJzJTC+EoZ6p5LFlOuD+EoWOQC 50vg== X-Gm-Message-State: AOJu0Yx/MSRhchnMRr368PVHLAdtXX6X1ty+tfcBsvuTYJhk7AcJViWD FLdluPwMkX7bIaDjDrUkJ8sc4x/uDOUUmdky763MeYd1KG2j+T+XusfamYbkN/YrnYc2WDLzszg mNcASPE/3sA6lpZlvnHdQyZXY9FGR X-Received: by 2002:a05:622a:196:b0:413:5f84:4246 with SMTP id s22-20020a05622a019600b004135f844246mr23735482qtw.10.1694095436439; Thu, 07 Sep 2023 07:03:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF+rjcbWYNvnecVp3NY7NLOjOlLUZK1HAsRkQPXQDbqo/+gvwkBChnKpT+NvcRnQlh8r/NXBw== X-Received: by 2002:a05:622a:196:b0:413:5f84:4246 with SMTP id s22-20020a05622a019600b004135f844246mr23735417qtw.10.1694095435595; Thu, 07 Sep 2023 07:03:55 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id fp17-20020a05622a509100b0041087c90049sm6203246qtb.52.2023.09.07.07.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 07:03:54 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 43A92B4FD2; Thu, 7 Sep 2023 16:03:53 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 11/16] ir: Fix forgetting canonicalizing some function types Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 16:03:53 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <875y4mf5bq.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, It appears some function types are not canonicalized. Fixed thus. * src/abg-ir.cc (maybe_adjust_canonical_type): Once a missing member function has been copied from it's destination to the freshly canonicalized type, make sure the type of the member function is canonicalized as well. (copy_member_function): Bind the lifetime of the new function type to the lifetime of the current translation unit. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-ir.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 93d79b33..2bbb1a49 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -15006,7 +15006,11 @@ maybe_adjust_canonical_type(const type_base_sptr& canonical, // class doesn't have that member function. Let's // copy that member function to the canonical class // then. - copy_member_function (canonical_class, *i); + { + method_decl_sptr method = + copy_member_function (canonical_class, *i); + canonicalize(method->get_type()); + } } } } @@ -22873,7 +22877,7 @@ copy_member_function(const class_or_union_sptr& t, const method_decl* method) old_type->get_is_const(), old_type->get_size_in_bits(), old_type->get_alignment_in_bits())); - keep_type_alive(new_type); + t->get_translation_unit()->bind_function_type_life_time(new_type); method_decl_sptr new_method(new method_decl(method->get_name(),