Message ID | 20230217214538.2177094-1-apinski@marvell.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp82849wrn; Fri, 17 Feb 2023 13:46:40 -0800 (PST) X-Google-Smtp-Source: AK7set/4HQdHKxBC6UvGIeLdS8K0XhWHB7fY06e2h57L0tPv2AeP+NQfQUI1AlvyzIZ5AmYuoY0O X-Received: by 2002:a17:906:818:b0:878:8249:bef6 with SMTP id e24-20020a170906081800b008788249bef6mr354911ejd.59.1676670400787; Fri, 17 Feb 2023 13:46:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676670400; cv=none; d=google.com; s=arc-20160816; b=Daqu2CbJFGP4pHZ8MNS2r0nvlUH58L05zP2TNidhT+th5GaMdIvD4qMjYwYbrnaj+F +/qjYC8da6CXViGrlU2Lvsgw0PIXznAhbGQE+orJqm3/JqGZ7M9YML84CBmx4Gr451WZ H5s+B/zsW8KktJfZ+i6OdDMyYaC7jYBkArAq9pxrx935qWAKVLnroB7fyxJOHZ0DokFh Q+X8CiwX9FUXb3G8fHCp0Jhit8D3ezv5OOE9Ciq0VQoobE+M7Mursh6Nu/ELxd95CywP 6HPJ11NXk0tp+dfokF/09n4VvrG5GtZ9mboDrxJzrPLDcdqa+rBsHbjJdQgKJWEhwB2p IlTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=W+rFsSWVy1Gz2Gv+ASKOCwvSE/Ldqftd+O2zrxXATGg=; b=m6nS/UqLUilSnmF/bpNWjCu9nK7CIPxfKO2Juw/cSEM7o3s03TZfN7q5QfAUXZeMxK fQRuiqkm2rIAEUlKHA2oqBpL2qEk9WJQ/fK3exzl/Y2ivrMbdaI5Q28hnJm5aPxayQwN hiywMJGXuLqHVG/jlKfiBIAV7geGeWkaezsvKQsqMmbtBHhFyQ5OrRZWrpo/jMoNpenI dX1iszdKGmYxWIXTsRGhR01Al/wifD1vyy2SndEX6POZLpwJUGAbRG9NDQXr2b296Y7V /fQf8YFF4v+MHO3kU9jZfb9JYNuT1DRkfnA/9UGRVZMFcI98xWvSLjyx506NEgbbl822 9V6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Mgp1EO7K; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id 9-20020a17090600c900b0088de3d552e0si6670527eji.859.2023.02.17.13.46.40 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 13:46:40 -0800 (PST) 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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Mgp1EO7K; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 721E7387101B for <ouuuleilei@gmail.com>; Fri, 17 Feb 2023 21:46:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 721E7387101B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676670393; bh=W+rFsSWVy1Gz2Gv+ASKOCwvSE/Ldqftd+O2zrxXATGg=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Mgp1EO7KAzPsYMBUEJcW2juAMcNpPUMw1N9CyZ9K28ZqbOU28Ssof5yqv+YhYOAUS ynO5e6ndy/KAGYC3k5Nr1XQM5V+KwWTRV1kl9zNFi9+sIBS0j73+P/w7JrpQjVNKMN X0MTJ8+o0mJHkwb/VUCW13etDH71czGnSWH50h/k= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by sourceware.org (Postfix) with ESMTPS id 6A6B4385828E for <gcc-patches@gcc.gnu.org>; Fri, 17 Feb 2023 21:45:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6A6B4385828E Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31HJQ2Us010621 for <gcc-patches@gcc.gnu.org>; Fri, 17 Feb 2023 13:45:48 -0800 Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3nsg88drs8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for <gcc-patches@gcc.gnu.org>; Fri, 17 Feb 2023 13:45:48 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 17 Feb 2023 13:45:46 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Fri, 17 Feb 2023 13:45:46 -0800 Received: from vpnclient.wrightpinski.org.com (unknown [10.69.242.67]) by maili.marvell.com (Postfix) with ESMTP id 434FE5B6925; Fri, 17 Feb 2023 13:45:46 -0800 (PST) To: <gcc-patches@gcc.gnu.org> CC: Andrew Pinski <apinski@marvell.com> Subject: [PATCH 1/2] Support get_range_query with a nullptr argument Date: Fri, 17 Feb 2023 13:45:37 -0800 Message-ID: <20230217214538.2177094-1-apinski@marvell.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: bh3iYFpT43N0JeNwFvOtY8QeimU1v_SL X-Proofpoint-GUID: bh3iYFpT43N0JeNwFvOtY8QeimU1v_SL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-17_15,2023-02-17_01,2023-02-09_01 X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, 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.29 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> From: Andrew Pinski via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Andrew Pinski <apinski@marvell.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758116341928242932?= X-GMAIL-MSGID: =?utf-8?q?1758116341928242932?= |
Series |
[1/2] Support get_range_query with a nullptr argument
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Andrew Pinski
Feb. 17, 2023, 9:45 p.m. UTC
get_range_query didn't support a nullptr argument before and would crash. See also the thread at https://inbox.sourceware.org/gcc/4f6718af-e17a-41ef-a886-f45e4ac3d7a4@redhat.com/T/ OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * value-query.h (get_range_query): Return the global ranges for a nullptr func. --- gcc/value-query.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, Feb 17, 2023 at 10:46 PM Andrew Pinski via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > get_range_query didn't support a nullptr argument > before and would crash. > See also the thread at > https://inbox.sourceware.org/gcc/4f6718af-e17a-41ef-a886-f45e4ac3d7a4@redhat.com/T/ > > OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. OK. > gcc/ChangeLog: > > * value-query.h (get_range_query): Return the global ranges > for a nullptr func. > --- > gcc/value-query.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/value-query.h b/gcc/value-query.h > index 63878968118..2d7bf8fcf33 100644 > --- a/gcc/value-query.h > +++ b/gcc/value-query.h > @@ -140,7 +140,7 @@ get_global_range_query () > ATTRIBUTE_RETURNS_NONNULL inline range_query * > get_range_query (const struct function *fun) > { > - return fun->x_range_query ? fun->x_range_query : &global_ranges; > + return (fun && fun->x_range_query) ? fun->x_range_query : &global_ranges; > } > > // Query the global range of NAME in function F. Default to cfun. > -- > 2.17.1 >
diff --git a/gcc/value-query.h b/gcc/value-query.h index 63878968118..2d7bf8fcf33 100644 --- a/gcc/value-query.h +++ b/gcc/value-query.h @@ -140,7 +140,7 @@ get_global_range_query () ATTRIBUTE_RETURNS_NONNULL inline range_query * get_range_query (const struct function *fun) { - return fun->x_range_query ? fun->x_range_query : &global_ranges; + return (fun && fun->x_range_query) ? fun->x_range_query : &global_ranges; } // Query the global range of NAME in function F. Default to cfun.