| Message ID | 20260602084541.3829876-18-poulhies@adacore.com |
|---|---|
| State | Committed |
| Commit | 65bac7957e117f7300dcd0ad61345c675acceb45 |
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F39284BA7980 for <patchwork@sourceware.org>; Tue, 2 Jun 2026 08:56:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F39284BA7980 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=HzqVt7kB X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 65E914BA23DC for <gcc-patches@gcc.gnu.org>; Tue, 2 Jun 2026 08:46:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65E914BA23DC 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 65E914BA23DC Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::334 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389972; cv=none; b=KqG+qIO1LKaX4u8ITF9sJqLoSOoAfP/yomWeDjLIURmB+HPjcS2IYR93KURCD7nSu6sZvb4Y+hnJl00NwDsiTgSZL/aCS7M6GJmda/uauTm2ioFL9J9Emmm2BnuhKvD1HdPk7fTC080eW4mrCJzqR7VLX3SDbM29QzZWg0BKnnk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780389972; c=relaxed/simple; bh=zxpuRyklQpzemKUtg/S5PhG59daxt4eCtsgnq0SajtM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UeaQqzoLqQxl2DPsG3tEJFkn4a4MMff+IGH0pnpOtHfV2hRej5E7WctbzzNrAS+gko6f8MZZyhtWmSeXPIdWFgqZYVFMZAmrtMEa5Cq38Lv60wmupcPSJbkcoAugX271JLclFYVC4j8+eANMCp2tjee/0X/G0itJm7te6D+b17I= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=HzqVt7kB DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 65E914BA23DC Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-49050bfe053so79851775e9.3 for <gcc-patches@gcc.gnu.org>; Tue, 02 Jun 2026 01:46:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1780389971; x=1780994771; 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=AjX37QQC5H206OZFs+fmvA3Jid8ukCSpT32RhZ+UOqc=; b=HzqVt7kBGVQFJqQVagcfTGo2GYUkXGm++8Ht6rQBTgHV8msxfKIOmQM72vCxBcM+Eg SCOuYVIN5dhI9Bg131tlP3SsQlzmzmWS76mQfe5QxQYYYYndkrfJMobi4mK9ntXpkzse W/bo8b5ZWfHdbdfRv3Y7vjggbEzvQ3S/PbBiUHUsc3kIOKgvYowhiKW4yXnznbbK9j2d 2Pw7+SQ/e4fAtMw9N/fBm1zOsAn5lrlZraPfJjk/H/rGHvEOy7m7FTiTVKiJM6Vm+cJP bTh3q7WphBLz0s0/VEOIuKkbDmlLHJKgJxTp+FIXTBHQsTe5y27zs0Nm5RiyfcyDUVfl yjFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389971; x=1780994771; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AjX37QQC5H206OZFs+fmvA3Jid8ukCSpT32RhZ+UOqc=; b=klMS0a4JGcn5aTQ8cgbsouxlJp9J7APIqw7UDqsCt3VadPYsdCIgAKPbQSR5eFG69w Dc+pmRrJ9+hflPQEQXcVaOY/MFv+Pkic2LuuYs/EJrD2htMfzYqx1v1mfXuLu03F9NvC 4SbnXCttMJ7+KtUwSU31N+PbCJ/1I1f+Hh6RtfxmWHYTQ8xCGZgyA9zmUy1P2o8LcFbt 62Oz6nov55cbJxR6mh7+4okQ3OoPe8OiWJywc6FWatmJd2bkJRF6j3K9xfGqXP+ASUt8 4IdGo1eeYZniQ82qwFM/pbF10NerV39LSIPL5G6LkdBJZPVcnLab3hoxuEzw1o8Awsnf 33FA== X-Gm-Message-State: AOJu0YxNdTwqFfPGySlDqYOJxqnH7Hnl/itixWpyLcvwuYcr2qTmH23U AIzhmshVaEPWZgTRgo/qif24gOusgMreCCi4i1a7nkPCECcuC/1aLYzgUJv4jbA1k1gwk7v/bpP MKpo= X-Gm-Gg: Acq92OE5qbUmRwHCd5xmaACPBYm80IwTKvZ2xGuTDy/AaKRr0i79FgC9RscyPX3wZyk LeqWtYY/0jtj/EJwHCYyJQV+doSzz2WTxwuPYyC4D7I3CeS0VL7SCT5MwJ+eDcmNLlD8JmbL9+0 gZj2XGSPcTOgApVXZ4icMWWgTpCzk9H3WI6y//7FJDtbsBOZ9IRMzjuV+sReLrqrbzHAgTrXxaZ ahzFXKZO/20tyGp6CrD1QvsJlCdTj63Xf0aACYu0V2YOgVmtQVCzpAwT+wuFYA4AqBQrJseWLpK AzFRxfzMNAczaIu4dd9enbUod3/C7UXsWC8JP84Ez+xn289LWfwhZiuS8YxOulT+O07QOzu/XtF Jyk2MXJkUeHS8rxWOL5dqB3b4MQelVj6dF2QI4ff7KbIOGu1WnJ9PkB3UdGDmRAYfbibtNl1sjW 8Rq/J7PJh8FBMDbARQX1P5YoTaVnEbc0eLN0w+6JVvuHcLqPZiq+Yl1r8xsvyR4f6CsVQHX83AI h3h+A17Lruu1ws4nrO27O7elPhkw+E= X-Received: by 2002:a05:600c:a11:b0:490:b0f1:c27e with SMTP id 5b1f17b1804b1-490b0f1ce6dmr49446375e9.24.1780389971347; Tue, 02 Jun 2026 01:46:11 -0700 (PDT) Received: from mecano.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490ab55d39csm33907625e9.35.2026.06.02.01.46.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:46:10 -0700 (PDT) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.com> To: gcc-patches@gcc.gnu.org Cc: Viljar Indus <indus@adacore.com> Subject: [COMMITTED 18/51] ada: Fix crash in Has_Assertion_Level_Argument Date: Tue, 2 Jun 2026 10:45:06 +0200 Message-ID: <20260602084541.3829876-18-poulhies@adacore.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260602084541.3829876-1-poulhies@adacore.com> References: <20260602084541.3829876-1-poulhies@adacore.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_PBL, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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~patchwork=sourceware.org@gcc.gnu.org |
| Series |
[COMMITTED,01/51] ada: Rename Private_Component function
|
|
Commit Message
Marc Poulhiès
June 2, 2026, 8:45 a.m. UTC
From: Viljar Indus <indus@adacore.com>
This method would crash if the association was not a
N_Component_Association. As it could be something else like an
N_Iterated_Component_Association that does not have the choices
attribute.
gcc/ada/ChangeLog:
* sem_util.adb (Has_Assertion_Level_Argument): Check for
the correct type of association.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_util.adb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 5698b2f0fef..43850d6cfc2 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -11510,6 +11510,11 @@ package body Sem_Util is end if; Assoc := First (Assocs); + + if Nkind (Assoc) /= N_Component_Association then + return False; + end if; + Choice := First (Choices (Assoc)); if Nkind (Choice) = N_Identifier then