Message ID | 20240614073633.2089692-6-poulhies@adacore.com |
---|---|
State | New |
Headers | show
Return-Path: <gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=QEl3s4it; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W0rkS3Hlzz20Pb for <incoming@patchwork.ozlabs.org>; Fri, 14 Jun 2024 17:38:56 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A958C388211C for <incoming@patchwork.ozlabs.org>; Fri, 14 Jun 2024 07:38:54 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 4C32E3882169 for <gcc-patches@gcc.gnu.org>; Fri, 14 Jun 2024 07:36:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4C32E3882169 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4C32E3882169 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::232 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718350614; cv=none; b=GpS3JThVv6yHzM66T70fPBQRRKlnwwzxyn/wedLVt0BC/xSUJ+rpUtHrKGjqAjhCKDoucupMI1l8S1aUGkHn7dHdoe9+DQJ3kjW1gmWZzg00DQiHGnI4YUfWcFkgr32FlfR5pldtYAWXQAohUxl7xrxTDqWAq2ResfQNKFUTP7c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718350614; c=relaxed/simple; bh=FIFkIhXJOJHYRs0Qy23uQMGhRP6neitFs+/x/7ptcdo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=IGxnLIOFxp6VFoiEqe3vp3XL7Tc6etI8BLiD1VbpS8Uv3flpv1NsbpQunTUFWWCyPBJrEuL+cRz6Prw3G8fKenUGq8zoZf3aoju3thXqq0od1pEqKp2dzIxXK3HjsxyJt1W+S//DsElz14LRi0z3r/Ycc7JbiUwSeyCPmo4Jt/4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2ec1620a956so4896111fa.1 for <gcc-patches@gcc.gnu.org>; Fri, 14 Jun 2024 00:36:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1718350609; x=1718955409; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=op0JBXfkSt/vp/7RGyGPOERRDh4sVLynJBRk3uHrgbY=; b=QEl3s4itww6UwPQmuHTMWAKl59LTDR+9Td3B3fPEsUMx9iG3imAoia806dGZCKAysq /b5C2PIOUUe0u0TRjAT37suj6unbah1Vu07rQBw3rKN8yrav59OhgXUMGSg/1+xTsQjr nxiYQ5/sfUvbeFI7PZjW4Atw02BWFbAhasZcmopngKphNaeu7PSJNo5sLc+ojsltphBn JcqcA4cwsgKH4jCwkktBV2P/lImjDsBPipgnVaUjEgMSFwBNOoEaEfm2MQj23bNE1Ll9 5x/sqETLzgC/o0+/WVNB0ABumaO/2K6un6bBga/F+Cl/7yZ74snRP3ngXPpKsaGIwa/g LYMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718350609; x=1718955409; h=content-transfer-encoding:mime-version: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=op0JBXfkSt/vp/7RGyGPOERRDh4sVLynJBRk3uHrgbY=; b=jSLI05rbXxO0WCz8GXP/5NHIRUeaD6pwTzKaoppLfbui5x6vriJ6MDxgIyzyt7fZaz VbL5JaWCCv7u7S5fMYo8E6hCQlq8eiA4dlS3HDtzOOWDGdBQZjfbXF2pmIbvCZDW1mig UwbaIrT5tGO54FZA+CzKH7gQGYRZIWvuDXJ1HkFAquinB00IVU0RATpibaiadYUkROa9 RTWDD1rHTUEIvBBkQfjhkqfpEzPiGPXKA+Kwb6qq4eFkPZ+1mPYNBQ+lQKhDN6XGi4Yh c7vWPoDyCqnB7u57wFnXF208Gm3G/NTITXQ09dtnSpqTOrEed6uzGU0Uh5xdRf9lzv7Q OfKw== X-Gm-Message-State: AOJu0Yz1uuV8pRbZP1RM2tpehGuCUhYE7bMU3PQw5vD0c9393YcBYdI9 58fN2EtOHUtkK6Kiogwm7vGt32w78k89LL2WFLkdCwF7hY61cdn+XtdHdROrMe9PZzi8/Y8HWpo = X-Google-Smtp-Source: AGHT+IHjD+c1zs1aHVssmTtKbwyNKNU9kEM6emUlVmeedFyEaaKcb9adXjL7rKAQqwqvS4uFnOrtTQ== X-Received: by 2002:a2e:6a10:0:b0:2eb:ecba:444a with SMTP id 38308e7fff4ca-2ec0e5d05c8mr11480321fa.23.1718350608658; Fri, 14 Jun 2024 00:36:48 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:cb5c:2e27:9d1c:5033]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36075093636sm3558191f8f.14.2024.06.14.00.36.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 00:36:48 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Justin Squirek <squirek@adacore.com> Subject: [COMMITTED 06/16] ada: Crash checking accessibility level on private type Date: Fri, 14 Jun 2024 09:36:22 +0200 Message-ID: <20240614073633.2089692-6-poulhies@adacore.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240614073633.2089692-1-poulhies@adacore.com> References: <20240614073633.2089692-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.7 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, 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: 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+incoming=patchwork.ozlabs.org@gcc.gnu.org |
Series |
[COMMITTED,01/16] ada: Remove unused name of aspect from Snames
|
expand
|
diff --git a/gcc/ada/accessibility.adb b/gcc/ada/accessibility.adb index 47b3a7af10a..da4d1d9ce2e 100644 --- a/gcc/ada/accessibility.adb +++ b/gcc/ada/accessibility.adb @@ -2227,7 +2227,11 @@ package body Accessibility is -- that of the type. elsif Ekind (Def_Ent) = E_Discriminant then - return Scope_Depth (Get_Full_View (Scope (Def_Ent))); + return Scope_Depth + (if Present (Full_View (Scope (Def_Ent))) then + Full_View (Scope (Def_Ent)) + else + Scope (Def_Ent)); end if; end if;
From: Justin Squirek <squirek@adacore.com> This patch fixes an issue in the compiler whereby calculating a static accessibility level on a private type with an access discriminant resulted in a compile time crash when No_Dynamic_Accessibility_Checks is enabled. gcc/ada/ * accessibility.adb: (Accessibility_Level): Replace call Get_Full_View with call to Full_View since Get_Full_View only works with incomplete types. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/accessibility.adb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)