From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by sourceware.org (Postfix) with ESMTPS id 8FF5B384A432 for ; Tue, 16 Jul 2024 14:55:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8FF5B384A432 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 8FF5B384A432 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4b98:dc4:8::226 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721141748; cv=none; b=dGxBwJvAETVDOap37Eh/BTHnI4MBZ34UDNQVN45RYKH5NEvjHv6nw9BGVp4KUHiqhOTetv8pdZTKCWakfasvz2imYcYPhMYj+YJSspWnriA4xinvEnJw26/FjsJzuTS4PSkPvP6RNW+A6lURkywrhmuQWGRLX/SEB2CE7vNmNWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721141748; c=relaxed/simple; bh=Bz43rcvLf212Wu9a/toaLR7m/LMwMdVjNMJ9SQvT0uo=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=gOuD9uSHhY4el28L4CADGSO2aL9+5vXKZYZAJd0KaKveOBAznTJgEX+CwxByIZQcahPi21/XxkQBJFxl0hVMuZ/191ugOUoV4qO2OQhvccJOE1fXBemK7G8GUNt+IDJVHGoNLJaNTJSWG+zF0nNiy79XZbQBEg/uWadrzQDp0Dg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail.gandi.net (Postfix) with ESMTPSA id E43BBC000A; Tue, 16 Jul 2024 14:55:41 +0000 (UTC) Received: by localhost (Postfix, from userid 1000) id 3A415C1B791F; Tue, 16 Jul 2024 16:55:41 +0200 (CEST) From: dodji@redhat.com To: libabigail@sourceware.org Cc: dodji@redhat.com Subject: [PATCH 04/17] corpus: Support adding translation units with empty path Date: Tue, 16 Jul 2024 16:55:15 +0200 Message-ID: <20240716145541.473065-5-dodji@redhat.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20240716145541.473065-1-dodji@redhat.com> References: <20240716145541.473065-1-dodji@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: dodj@seketeli.org X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,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 List-Id: From: Dodji Seketeli The CTF front-end produces an artificial translation unit with an empty path for all the types in a given ABI corpus. Adding such a translation unit to its corpus is conditioned on it having a non-empty path. Oops. Fixed thus. * src/abg-corpus.cc (corpus::add): Do not require that the path of the translation unit be non-empty. Signed-off-by: Dodji Seketeli --- src/abg-corpus.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/abg-corpus.cc b/src/abg-corpus.cc index 1239deb0..994307fb 100644 --- a/src/abg-corpus.cc +++ b/src/abg-corpus.cc @@ -14,6 +14,7 @@ #include #include #include +#include #include "abg-internal.h" @@ -724,14 +725,11 @@ corpus::add(const translation_unit_sptr& tu) { ABG_ASSERT(priv_->members.insert(tu).second); - if (!tu->get_absolute_path().empty()) - { - // Update the path -> translation_unit map. - string_tu_map_type::const_iterator i = - priv_->path_tu_map.find(tu->get_absolute_path()); - ABG_ASSERT(i == priv_->path_tu_map.end()); - priv_->path_tu_map[tu->get_absolute_path()] = tu; - } + // Update the path -> translation_unit map. + string_tu_map_type::const_iterator i = + priv_->path_tu_map.find(tu->get_absolute_path()); + ABG_ASSERT(i == priv_->path_tu_map.end()); + priv_->path_tu_map[tu->get_absolute_path()] = tu; tu->set_corpus(this); } -- 2.43.5