Message ID | 20231024103000.3334790-2-richard.sandiford@arm.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1844495vqx; Tue, 24 Oct 2023 03:30:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHiQ6O6ti6ejUvhVDFwrRTzBPP4sTY110kQ16pOAx6CdaCATxG2pWyt5SH5aLcIvUrGqEiL X-Received: by 2002:aca:1004:0:b0:3a9:e8e2:57a7 with SMTP id 4-20020aca1004000000b003a9e8e257a7mr10717026oiq.53.1698143455758; Tue, 24 Oct 2023 03:30:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698143455; cv=pass; d=google.com; s=arc-20160816; b=PCZkSVpcrYQKu7bbPhCfIYis6B7RIzNFOGe6MZ8xRP8CUdLOqS9fsV35lUmp+tRhhJ u238UPDmqwrRUF8mIVPwibcGGQGdeTY7X30k0w0rnuW9lafCjbCAtUqT2o54wazZ9i8E GphQZSs246ttN/EIzhqtHdmEp1QbJURvSSmSAHJC64A4nXJni7D0jNX+++1wHNaGvEiZ G8UVzgMehhZ8hUgVpvWy+S4A8+BpBO82ovzs1zuvraObuQrIzXBhjZuDSKqPoiQMAnQ/ zPxXB4YoWstJjFTf+soTgco6VW0fZcTZhkHofbxNikPbc8Z5mNa0TJ19fO0mxuoVMwRx cVew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:arc-filter:dmarc-filter:delivered-to; bh=CHJ5GU5wy1tDHsvROYekGEVDhi6hv+9FVTPQIvHzVq0=; fh=C4nEn4uRKApr1WsFtLyJD8L5BeRuRc+JFyqoopFjd9M=; b=LJMVqo9OsGTZicRQr7nsaiWOaPDiwcbJzjxbnrKzMqC8dfx//YOe+JKUpQEQXgIRSS Gmd/vPJIOp4PTnGPcYkRKM//AWk9wuyFZ3aN8DS4m7fD8HsRaM2VBRqXLf6c38mwniHR nUJDcV7P87aV+zBXeRzJWO9+yQBxqMAiwrl9kxdGRgguf4aZUU1GG2XDatv7VL7pYs+2 vEjEqYhjuYTKLEA2MEgf7I9zuogs3vdgr0fEHRmfY26vZvXlemTTK/vRY6dCVynT8iWA Q8ugPAyBwjp3bb34meBJnElPDs/hf2V/X5V/6LgtebQAZYqRcOGh20fEEHxs7a4sH9sa gmzA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id j4-20020a0cc344000000b0066cf06339c8si6856628qvi.197.2023.10.24.03.30.55 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 03:30:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 152353857345 for <ouuuleilei@gmail.com>; Tue, 24 Oct 2023 10:30:55 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 86C573858CDB for <gcc-patches@gcc.gnu.org>; Tue, 24 Oct 2023 10:30:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 86C573858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 86C573858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698143430; cv=none; b=q+FBzc/x3XsjgTzrhMvs89E8uULd6/w/G/kctwmSbxrCqORIdC8opQk1929i2UimzfzlbCnEZ76xNKp3xPFpAm4EFCsmcCUHWFi2tGajUfsooi0DqNhgofKLiSjehOi8VBusho0Ib1HoUgogHMfThsiP1in5qARyDtz5a4xWTfk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698143430; c=relaxed/simple; bh=Mn3zMihwTZRwQptwwWv3OJQ3XAbcxYbu/gT7qJpJ18E=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=fLc+vMDz1YmRoyTN/bcgJhta/vJTSf4iolHcur6UXjR4GrzFWtYxUBmw6y0CVXN92FrMw2cXa+E74Ea+An7da1IEUnSu8VymgVNIAlRnBEBDiGkKeu0LR1BVzK8pyMV9qb+5I2vVvSmNytNjaCMwKeF5VlYHwVPyuR7OOEqfNHs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4926BC15; Tue, 24 Oct 2023 03:31:06 -0700 (PDT) Received: from e121540-lin.manchester.arm.com (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CC41D3F64C; Tue, 24 Oct 2023 03:30:24 -0700 (PDT) From: Richard Sandiford <richard.sandiford@arm.com> To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford <richard.sandiford@arm.com> Subject: [PATCH 1/4] rtl-ssa: Fix null deref in first_any_insn_use Date: Tue, 24 Oct 2023 11:29:57 +0100 Message-Id: <20231024103000.3334790-2-richard.sandiford@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231024103000.3334790-1-richard.sandiford@arm.com> References: <20231024103000.3334790-1-richard.sandiford@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-24.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780632472011772478 X-GMAIL-MSGID: 1780632472011772478 |
Series |
[1/4] rtl-ssa: Fix null deref in first_any_insn_use
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Richard Sandiford
Oct. 24, 2023, 10:29 a.m. UTC
first_any_insn_use implicitly (but contrary to its documentation) assumed that there was at least one use. gcc/ * rtl-ssa/member-fns.inl (first_any_insn_use): Handle null m_first_use. --- gcc/rtl-ssa/member-fns.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/rtl-ssa/member-fns.inl b/gcc/rtl-ssa/member-fns.inl index c127fab8b98..3fdca14e0ef 100644 --- a/gcc/rtl-ssa/member-fns.inl +++ b/gcc/rtl-ssa/member-fns.inl @@ -215,7 +215,7 @@ set_info::last_nondebug_insn_use () const inline use_info * set_info::first_any_insn_use () const { - if (m_first_use->is_in_any_insn ()) + if (m_first_use && m_first_use->is_in_any_insn ()) return m_first_use; return nullptr; }