From patchwork Wed Feb 7 16:53:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 85433 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 AD7953858032 for ; Wed, 7 Feb 2024 16:56:30 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 65EFF3858025 for ; Wed, 7 Feb 2024 16:54:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65EFF3858025 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 65EFF3858025 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707324892; cv=none; b=eQJEOS0F4ox9UNMR79vEGESZ8HAH1pjBHtsyQFStGWVmyZMrvHBUeJ1Sic0hqc7mR28MrgEraGqL4bTiDpPpaicTzwK5G4WfhYUx1Z1vKG56gd9Is3fERBY66arfGR3GKEBX5hswIc512hUQv5Ga3BzGtSJKB4w2R99xVymHzVk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707324892; c=relaxed/simple; bh=/mnQ4tLa0mjJWYaRD4y8x6CCPYitIJBCrTEz5PhuyCI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=bspFy5Gwza6pRGPgyYTojmQLLcyJEpYSGaHKKNPB0Q8VEPcLrYJ4vzls7dZmlYsdUTiyOvdk33BIu0fleSnEN6JBkV0T+2DN4GZm/OyPhDlO33cDJR53ahB1p8SOc5SX/tl0Bv1+FfIPSJzV6QE5gG6s/Rqj5L7kQWmKFCk2QHo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smarchi-efficios.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 41FBE1E11E; Wed, 7 Feb 2024 11:54:48 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH v2 5/5] gdb: remove unnecessary nullptr check in remove_user_added_objfile Date: Wed, 7 Feb 2024 11:53:23 -0500 Message-ID: <20240207165445.117512-6-simon.marchi@efficios.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240207165445.117512-1-simon.marchi@efficios.com> References: <20240207165445.117512-1-simon.marchi@efficios.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3496.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Since commit 74daa597e74 ("gdb: add all_objfiles_removed observer"), the objfile passed to the free_objfile observable can't be nullptr. Change-Id: If215aa051ab43c068b11746938022c7efca09caa --- gdb/solib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/solib.c b/gdb/solib.c index 991ff156d12f..952897c37fc9 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1695,7 +1695,7 @@ gdb_bfd_lookup_symbol (bfd *abfd, static void remove_user_added_objfile (struct objfile *objfile) { - if (objfile != 0 && objfile->flags & OBJF_USERLOADED) + if (objfile->flags & OBJF_USERLOADED) { for (solib &so : objfile->pspace->solibs ()) if (so.objfile == objfile)