From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id aj/4NvPrOmo5ThUAWB0awg (envelope-from ) for ; Tue, 23 Jun 2026 16:26:27 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fvh6MYuO; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CDDD11E070; Tue, 23 Jun 2026 16:26:27 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (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 ESMTPS id 2995B1E070 for ; Tue, 23 Jun 2026 16:26:27 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1C7174BA2E15 for ; Tue, 23 Jun 2026 20:26:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C7174BA2E15 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fvh6MYuO Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id A0B154BA2E19 for ; Tue, 23 Jun 2026 20:25:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A0B154BA2E19 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A0B154BA2E19 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782246355; cv=none; b=MD1sCsfJkYlo1eUVgey36mamTGgWaBOxJ3EXfv+zvSN0ZWeCEFQW/eU0Z9ruLNDnmKoozQMjNzfytvs2I0eZvpAiS8YcErvsaPIFgnkjLnZ/9CqNSrWLOca3VmEbEcem4h0lnfpnIBYEPyoQt5onLLw8TB27yXT4lLhQKIaaz4c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1782246355; c=relaxed/simple; bh=V19AmBGzdldREGpbwjH6JvxVTLFtuVXOacvVvjCbFe8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=A1v2NczjEtcX9fdHHsbrdWnfwu2vWETZOtGlxkPzBcoqesTyqMzUDXALAQw2XcwjYH1WQhKmdN2e/CeHjPXFujvPmBQgfQZRHdWt+4Q/+IwnpBLwPyuHi2J6ppv9DWlTJmDl2Xn2W7Xy9klLgEA4gnSzei6CrpJMZTVjPUKitkU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fvh6MYuO DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A0B154BA2E19 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1782246355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wfSIkyUaGS038aftDsrYpeAoePNTveBhEOgIe84K2Cc=; b=fvh6MYuOOf5krIru7b3MQJaMWzmKBDUEzZORXeB/x4+fWjZA2I5SW+VC8i7Nkp9uREQcx7 emFQNWQHUD6gm4ot1ixe6Brn7fpEf/jJ6frF2IDrRfnhhHi67q545gGiAQsxaXViXAjtoo chNguTRoVVTXtW5RslZ32Y6tgkiuHAU= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-440-PteFjCJ6OFqvlavS60yrdQ-1; Tue, 23 Jun 2026 16:25:53 -0400 X-MC-Unique: PteFjCJ6OFqvlavS60yrdQ-1 X-Mimecast-MFC-AGG-ID: PteFjCJ6OFqvlavS60yrdQ_1782246352 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 107061801F09 for ; Tue, 23 Jun 2026 20:25:52 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.96.134.23]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1491030001BE; Tue, 23 Jun 2026 20:25:49 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH] gdbsupport: Remove some use after move instances Date: Tue, 23 Jun 2026 17:21:54 -0300 Message-ID: <20260623202153.2743258-2-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 7Uy1FUoVrr1NzfY6uHmmiO_kRKTY_rrGpZ_82Q0IigE_1782246352 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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~public-inbox=simark.ca@sourceware.org A static analysis tool was ran on GDB and pointed out some instances of "use after move" in GDB. The instances that could be easily removed are related to move constructors for exceptions, that were using the parameter's reason in an assert, when they could instead just use their own internal "reason" member. This patch fixes that small oversight. --- There was another issue raised, but it was in the unordered_dense library, which I don't know if I can just change or if I should submit a PR to the upstream library. --- gdbsupport/common-exceptions.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdbsupport/common-exceptions.h b/gdbsupport/common-exceptions.h index 1f3bc84216e..37c6e94d5a3 100644 --- a/gdbsupport/common-exceptions.h +++ b/gdbsupport/common-exceptions.h @@ -297,7 +297,7 @@ struct gdb_exception_error : public gdb_exception explicit gdb_exception_error (gdb_exception &&ex) noexcept : gdb_exception (std::move (ex)) { - gdb_assert (ex.reason == RETURN_ERROR); + gdb_assert (reason == RETURN_ERROR); } }; @@ -312,7 +312,7 @@ struct gdb_exception_quit : public gdb_exception explicit gdb_exception_quit (gdb_exception &&ex) noexcept : gdb_exception (std::move (ex)) { - gdb_assert (ex.reason == RETURN_QUIT); + gdb_assert (reason == RETURN_QUIT); } }; @@ -327,7 +327,7 @@ struct gdb_exception_forced_quit : public gdb_exception explicit gdb_exception_forced_quit (gdb_exception &&ex) noexcept : gdb_exception (std::move (ex)) { - gdb_assert (ex.reason == RETURN_FORCED_QUIT); + gdb_assert (reason == RETURN_FORCED_QUIT); } }; base-commit: 717ef05c9c6d5f7a07540df2e79853d04b56f750 -- 2.54.0