Message ID | 20230405140411.3016563-52-arthur.cohen@embecosm.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp352299vqo; Wed, 5 Apr 2023 07:31:37 -0700 (PDT) X-Google-Smtp-Source: AKy350ZD7as4f2SZ+ZxgQJD/ct8+19pb9r/0hapXXIftzF430wNOntm88SPGmoiiaYtI3vUiG768 X-Received: by 2002:a05:6402:299:b0:4fa:d2b1:9176 with SMTP id l25-20020a056402029900b004fad2b19176mr2151887edv.22.1680705097152; Wed, 05 Apr 2023 07:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680705097; cv=none; d=google.com; s=arc-20160816; b=nlmQxyahZjWpuAnxX7l6kmM+PvNsB/wU2xkvz6y06CHaNaxXE9S7Clben63xiVjaa0 7FyykZTrw8yKuOnPSj0rtitFCMxxxoa+B8Qf6+SZ1Cvwa8aNHPDHarDJeNBAq43ooqeB qB67tzFed4gUZBHHAovX/kfvpu1rwRFEElZ8zUXv3UoFzmhScGEKt0MbWVKmllu0ej5u 6YNuZwSrC2QhBKn6zsx8gwh1aJlkvN+dOkvF/mYsshzdhRcprGKhZfqypgaC8dp+nLUW bgY1p/1VwpBN+mBqYnPqr8PbCYts0FAvijRsKO9PaP2b7u4piK/T1jg3WUJ1Y03YsvH/ beIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-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:dkim-signature:dmarc-filter :delivered-to; bh=O2C3MPkFyXnroG9vHH/7lMQUeq/H1QA7c60IBOW3oXM=; b=wPw7UtqUepDWIafrcWfZLnQiuQHXvRmMtlXm2qyGcrDmXxhXE0a0uAklWy6a6oo88X 9GmjErOdUOagzouWsLXmjsOQNipfztSyHIze9iLV8iw1ocU0xXp884x+JiSXlZYohvag 0N5NVk317P6PVrpRiIVVpTOXZUZe8xwKruOch7PbAuAGUkXjpQGViQLjzMk+DQtqDEmv UTfI4Vt7llHS+yCCahKt/4nLd81DJEiXYHtnF7hfAh7kxV1Yx0TITDlavwsUHrp+qRkv YdQQvEz62JTgEj2NpbFyFn8bqAEuQR8OeqBUjrdMQmVrlzeZQHomHBW9kfhjV2FkjEiY qhwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b="EDks/L8h"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id z3-20020aa7d403000000b004fcbdc5577fsi1100192edq.59.2023.04.05.07.31.36 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:31:37 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b="EDks/L8h"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 136193881D1B for <ouuuleilei@gmail.com>; Wed, 5 Apr 2023 14:12:40 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by sourceware.org (Postfix) with ESMTPS id DDBD03876898 for <gcc-patches@gcc.gnu.org>; Wed, 5 Apr 2023 14:06:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DDBD03876898 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x32b.google.com with SMTP id l15-20020a05600c4f0f00b003ef6d684102so18506801wmq.3 for <gcc-patches@gcc.gnu.org>; Wed, 05 Apr 2023 07:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1680703564; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=O2C3MPkFyXnroG9vHH/7lMQUeq/H1QA7c60IBOW3oXM=; b=EDks/L8hosp5VOqgLD5k4dOM7KyeooqOAlGjQzKj9k8fO9g2mzjJ/tIDEq33w+x8xd RjN2McMR1UbNyzsT08NBI0TmXdSuGfAmZCt4K27YQuuh2ToJOGc8RdbruEcFtxBLVNRL jocTh4v+Ow/ZPW22bxxKoYcosTcO6VY4TmO+8isUcSL0S5GkcGXcEM2uY++oo5ub7ura Gv8S0ll6+MBVg+N2g/b+8BwocU60k9vX/k68FT1FyUMqBvAK2gp2WUW85zAT/XrlvFRS 8AsQ+nIsbWJA8vkQCF1ak23my0Zo3EH2vkuETGZNLpCk1Lv4gY5iYmRcfrYcLZ/b2Zvu G1gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680703564; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=O2C3MPkFyXnroG9vHH/7lMQUeq/H1QA7c60IBOW3oXM=; b=KoMs/ZXHrAcy3PxFD+7ur1F87nWLjpu2pr3+sTm/BIqzWj5UBY3Ejryr39yIk7GtW3 SNTw7UTQK0yLuxbybMsEEVO/wpOnYr7XR3M3XgFqI6ZvbOrIt35+3T8W7Ro65Mb/sLME yjwNsZlxy+cyHyXEsAKd9k1gb4eNxdcwSS5L1a8nbpOMEd+vp/mPw77fag+UhncwNG1/ fS3uIYpZ+HH50fjW0TvhSkeC+magBrfLtFF6wRLrIOqG1Q2Gndb2l5mo7LaQAWwaUrkR cN+uSDmIk2yGxjTCpg0rGPxhlCHqrzCJFP0+dbRT6I2kQpU52+d2SGuVfx9EaKEtEl+S TtRw== X-Gm-Message-State: AAQBX9f45tJ7m07+R9gmyb87D9Cj5umX2Uy7BEE0sXzeocEg5d/xOSDs iVcYsA8Qj0v7FKTamlVVb8OmqKDCMr8MxikcHw== X-Received: by 2002:a1c:4c09:0:b0:3ef:6fee:8057 with SMTP id z9-20020a1c4c09000000b003ef6fee8057mr4728496wmf.25.1680703564305; Wed, 05 Apr 2023 07:06:04 -0700 (PDT) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id ay8-20020a05600c1e0800b003edddae1068sm2330150wmb.9.2023.04.05.07.06.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:06:04 -0700 (PDT) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Philip Herron <herron.philip@googlemail.com> Subject: [committed 51/88] gccrs: Fix nullptr dereference Date: Wed, 5 Apr 2023 16:03:35 +0200 Message-Id: <20230405140411.3016563-52-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230405140411.3016563-1-arthur.cohen@embecosm.com> References: <20230405140411.3016563-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable 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> Reply-To: arthur.cohen@embecosm.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?1762347027952583836?= X-GMAIL-MSGID: =?utf-8?q?1762347027952583836?= |
Series |
[committed,01/88] gccrs: fatal_error_flag: Fix typo in error message
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Arthur Cohen
April 5, 2023, 2:03 p.m. UTC
From: Philip Herron <herron.philip@googlemail.com> When we check if this is concrete the guard checks to ensure the argument is non null but the check here is wrongly returning early when the check is non null meaning when it is null and therefore not concrete it will end up doing a null dereference. Signed-off-by: Philip Herron <herron.philip@googlemail.com> gcc/rust/ChangeLog: * typecheck/rust-tyty-subst.cc (SubstitutionArg::is_conrete): fix check --- gcc/rust/typecheck/rust-tyty-subst.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/rust/typecheck/rust-tyty-subst.cc b/gcc/rust/typecheck/rust-tyty-subst.cc index 7f5bb22687d..996bbf2d885 100644 --- a/gcc/rust/typecheck/rust-tyty-subst.cc +++ b/gcc/rust/typecheck/rust-tyty-subst.cc @@ -213,8 +213,8 @@ SubstitutionArg::is_error () const bool SubstitutionArg::is_conrete () const { - if (argument != nullptr) - return true; + if (argument == nullptr) + return false; if (argument->get_kind () == TyTy::TypeKind::PARAM) return false;