From patchwork Wed Aug 14 12:56:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 95824 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 F1BDB3858428 for ; Wed, 14 Aug 2024 12:57:42 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by sourceware.org (Postfix) with ESMTPS id 4D6F53858424 for ; Wed, 14 Aug 2024 12:56:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D6F53858424 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=seketeli.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4D6F53858424 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723640217; cv=none; b=CzRkAoM/1o1YFxeD4oeHjYCl8r/VOPmI8cbo/Pesz/w3Y8YNCZQQ5nm6yzd4nxzAjT8UJq7qb460C7lbHr8T075ERPTHI/8RgxO1OAioAh/Z0WHMXNVwYRgDcvB3Xl0yOGjmO1DxgyJZIufaizha66XMBTO0aU4HX74QASIKjwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723640217; c=relaxed/simple; bh=lG0q7Zu7czRNRwYd7BVmc1NYw1qZFV7JinNmInt3cYU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=ipvvyZIuSQDOuGicNK9slOlKPZx2cH9GmKUa6upYre4KCQCPiZUsMFGMOHKAocfJMJzwm7Iheh5I84bg8w66lID7qQD+ec8SG1L83wvRoDHfCpSRnlSm10Oy/DmlkfVnsjTVcX31HuDiR/s7w2HBgHDC8oj9E81sNNL1wG9akOc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail.gandi.net (Postfix) with ESMTPSA id 2D291240002; Wed, 14 Aug 2024 12:56:51 +0000 (UTC) Received: by localhost (Postfix, from userid 1000) id 3824A507A634; Wed, 14 Aug 2024 14:56:49 +0200 (CEST) From: dodji@redhat.com To: libabigail@sourceware.org Cc: dodji@redhat.com Subject: [PATCH 10/11] reader: Fix building of reference type Date: Wed, 14 Aug 2024 14:56:48 +0200 Message-ID: <20240814125649.47119-10-dodji@redhat.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20240814125649.47119-1-dodji@redhat.com> References: <20240814125649.47119-1-dodji@redhat.com> MIME-Version: 1.0 X-GND-Sasl: dodj@seketeli.org X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces~patchwork=sourceware.org@sourceware.org From: Dodji Seketeli This patch ensures that the built reference type IR node is always associated with the type-id used in the ABIXML. * src/abg-reader.cc (build_reference_type_def): Remove unnecessary condition. Signed-off-by: Dodji Seketeli --- src/abg-reader.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/abg-reader.cc b/src/abg-reader.cc index 64d16171..8c66d6b4 100644 --- a/src/abg-reader.cc +++ b/src/abg-reader.cc @@ -4346,8 +4346,8 @@ build_reference_type_def(reader& rdr, is_lvalue, size_in_bits, alignment_in_bits, loc)); maybe_set_artificial_location(rdr, node, t); - if (rdr.push_and_key_type_decl(t, node, add_to_current_scope)) - rdr.map_xml_node_to_decl(node, t); + ABG_ASSERT(rdr.push_and_key_type_decl(t, node, add_to_current_scope)); + rdr.map_xml_node_to_decl(node, t); type_base_sptr pointed_to_type = rdr.build_or_get_type_decl(type_id,/*add_to_current_scope=*/ true);