Message ID | 20230529082914.2409826-1-poulhies@adacore.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1363042vqr; Mon, 29 May 2023 01:36:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4eOG9Z4uWaiIJ/hIJ4XPhvC2r0a66EqsaW2PS6i+xt2sL99tmr5ZGvx96iAp0fu2BIV6ok X-Received: by 2002:a05:6402:2d1:b0:510:ec67:22d2 with SMTP id b17-20020a05640202d100b00510ec6722d2mr7812265edx.10.1685349403659; Mon, 29 May 2023 01:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685349403; cv=none; d=google.com; s=arc-20160816; b=MPWlpC0C0HLY0jFn7JcwWueN/UGpKNKTg4HDKSIm4eKz7kftw1hitpqRjlCDUc6hMj xrLEVSMVArhvE/yGHe/UG7G2JzsvNFHVxVIYfRD+Pel+GQa3EkOjGU7Jl0yAn4fcbkVT nGnD4WMlEEg5dxNw+Kl0+FF7mNmGrnFBQT/NcgIBPuC8wSBRG8i/OfnpVagJLSdenr2e 7erarTls1UWBtophhSrzsy7j2cONaHfLL5Tj3NlT1msrIUIjbaQAyJjrXXXTI68qXugH AkMcuccUv6RdyprccQqXjoxERIW88ceGI/KX89jqcMkxUdAWleggOCC6f3GuxUPHneD2 7/DQ== 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=z166ZO081lpyRV8f+TJsCvpw1RXaCL1P7hPIvCvYInQ=; b=yDpuWW3IKwzVCK/Z4plZCSYzSn7scAhYBYWfpvEyC4Q+0OAzel68a4/XGG3cYQaaXa TIIsrson9eoqqbgqkP2UXaj/1Luv80b4ByGYoV6FSi1EBnjHMRwiZWXNR/4NsPPsjpbo 7gfJcccLMIMsVRjXngJwpnHWXfFtzPfWwDrKefcQ2U3/hhZ3k6FLmWs8aNoEJtWr/s3W hesUn/4A2BTBWg4jdqB2TcKwCYsJds6LHsjy+82k4POBRiGmX+eWZDETvIi9ItyevkWq Phu9I8q7xoX4LsLedy6v2+W+97mUDhCFcs36nyf86w5REPxjoCn+G29fO0udJlTiKdMU npaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=itPw0ThZ; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n10-20020aa7db4a000000b00514a5fe82easi71766edt.410.2023.05.29.01.36.43 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 01:36:43 -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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=itPw0ThZ; 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 6B751389839D for <ouuuleilei@gmail.com>; Mon, 29 May 2023 08:33:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B751389839D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685349198; bh=z166ZO081lpyRV8f+TJsCvpw1RXaCL1P7hPIvCvYInQ=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=itPw0ThZIsLzRMvEWM3Kz62gjciTnJCil06dw72akaflD70TAxlAi5EIHVZmaabFU lIrdhU8CjPOqHG1Zt+uuOHRlnoshlEZE8zjTrUIm77dIeq81Cw3lkPAegi6fiykH3r w4TZgDU519+4mU/g+bCFKtCk5v8upmVMNFz5UoeA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id A2D54385483B for <gcc-patches@gcc.gnu.org>; Mon, 29 May 2023 08:29:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A2D54385483B Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3095557dd99so2935246f8f.1 for <gcc-patches@gcc.gnu.org>; Mon, 29 May 2023 01:29:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685348955; x=1687940955; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=z166ZO081lpyRV8f+TJsCvpw1RXaCL1P7hPIvCvYInQ=; b=V7LFWvOVz9zXLp4Nsdiub1bpwyyWlonGud5XqV8iceCN/cBAgt9J4E9a/YdZ5AOQDn 8ykDHN7kuaeT1Y+tPoJheAOijAay4DXW0ue39pmkVb4eHMXUCB/3JBALo257i359ReCn /TOuTjq3VIqWSp7kBTWcbbDCG838KYkfymmidf/k4M9dGFghpo7DlIyvoJL1qGzk17eN tG5rerfcVUAJLp/WaeQxFP+7ADLRwIwZp2d4tGYMNbvzNyKJord0Qh/dADqREcui33bj TvERuH1vpA8WyIpVX9Or5G/bmLzFVsJGQ/sA+hO/K/zchsfdjtGI0oCNx998NKVwq7tN Ml8w== X-Gm-Message-State: AC+VfDyaZ6uND2T4mGqW9qLBvHb3hv5tR9VLb0e3h0AqxrIrRj0+ohrq 3vm30JJtNBd1pc3yIlHNgw7iv+Ge0VWLZriXTZoZjw== X-Received: by 2002:a05:6000:d2:b0:2f9:4fe9:74bb with SMTP id q18-20020a05600000d200b002f94fe974bbmr8600228wrx.40.1685348955610; Mon, 29 May 2023 01:29:15 -0700 (PDT) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id 24-20020a05600c021800b003f080b2f9f4sm16960059wmi.27.2023.05.29.01.29.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 01:29:15 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Javier Miranda <miranda@adacore.com> Subject: [COMMITTED] ada: Crash on aggregate for tagged record with discriminants Date: Mon, 29 May 2023 10:29:14 +0200 Message-Id: <20230529082914.2409826-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 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.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: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= <gcc-patches@gcc.gnu.org> Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= <poulhies@adacore.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?1767216936100583823?= X-GMAIL-MSGID: =?utf-8?q?1767216936100583823?= |
Series |
[COMMITTED] ada: Crash on aggregate for tagged record with discriminants
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Marc Poulhiès
May 29, 2023, 8:29 a.m. UTC
From: Javier Miranda <miranda@adacore.com>
The frontend may crash processing an aggregate initializing
a derived tagged record type that has discriminants.
gcc/ada/
* sem_aggr.adb
(Resolve_Record_Aggregate): For aggregates of derived tagged
record types with discriminants, when collecting components
from ancestors, pass to subprogram Gather_Components the
parent type. Required to report errors on wrong aggregate
components.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_aggr.adb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index fd0779e66d7..edd495b8359 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -5632,7 +5632,7 @@ package body Sem_Aggr is end if; Record_Def := Type_Definition (Parent (Base_Type (Parent_Typ))); - Gather_Components (Empty, + Gather_Components (Parent_Typ, Component_List (Record_Extension_Part (Record_Def)), Governed_By => New_Assoc_List, Into => Components,