From patchwork Wed Aug 14 12:56:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 95815 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 8C55D385841C for ; Wed, 14 Aug 2024 12:57:05 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by sourceware.org (Postfix) with ESMTPS id 87D083858403 for ; Wed, 14 Aug 2024 12:56:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 87D083858403 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 87D083858403 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.70.183.195 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723640214; cv=none; b=UUCPlB2F2ULkT0XLXXVahH1NkWXJmelrYCAjrVEuRxxwxQ4372Fi5rGajqIOlW+jBc7SO/oplvfmpORF+gIbwUhA778HuSWSREZNIHRkvjQt1AGxwFk9R/oYhHlGJKRt+Pt41h2/nSgykLbvuaebQHVse3bgewY1N3pw59H29MI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723640214; c=relaxed/simple; bh=UwAwm9E4wVhjMCPCoeWHQwUQ8bKDSB27GpF8Isln02k=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=fIr3Fo8ibZXCLpkm5ZVNM+ZU1lrEJ3XfStor+z21cnkjMqTQbZiZ+Aj5hCoYOvNouPZRlcUOmO0pj5X31AGQd6oqZJZq0Cha1zbfc58kUPIAi5rzNOxqRnc2e12tpkTlgf74U9bsu7vBhWMbh9CTC2yDPedmKgwjDGjOeQCpg/g= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail.gandi.net (Postfix) with ESMTPSA id 0F42060002; Wed, 14 Aug 2024 12:56:49 +0000 (UTC) Received: by localhost (Postfix, from userid 1000) id 27FE2507A623; Wed, 14 Aug 2024 14:56:49 +0200 (CEST) From: dodji@redhat.com To: libabigail@sourceware.org Cc: dodji@redhat.com Subject: [PATCH 03/11] ir: add_decl_to_scope shouldn't abort on nullptr scopes Date: Wed, 14 Aug 2024 14:56:41 +0200 Message-ID: <20240814125649.47119-3-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=-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, 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 * src/abg-ir.cc (add_decl_to_scope): Do not abort on an empty scope. Signed-off-by: Dodji Seketeli --- src/abg-ir.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index f6d7c527..7d8de813 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -8415,7 +8415,8 @@ scope_decl::~scope_decl() decl_base_sptr add_decl_to_scope(decl_base_sptr decl, scope_decl* scope) { - ABG_ASSERT(scope); + if (!scope) + return decl; if (scope && decl && !decl->get_scope()) decl = scope->add_member_decl(decl);