From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 75C76384AB64 for ; Tue, 7 May 2024 07:59:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 75C76384AB64 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 75C76384AB64 Authentication-Results: server2.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=1715068801; cv=none; b=aJDQD4sAl72iyFZHXO7gg/Hs9tMJoxWxnmW7ua4TXiUxr6B2uJwIbm8ka2YpIQ1DA4Fzp83MnYoObnmjHKNllHnWTpnNmW2N2s+kRrGL2iSuJtFJmXFgY2opFXcb5Uc0NRwkj6yT56dH7JLVkOrAk0Jj3YCeErLb6huM98yfTbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715068801; c=relaxed/simple; bh=LWJQL+WPcI2JP4w/q7QUeI1QMX9c7+rfXpTp2XYnOxQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fxo9T5ZxZatuz9P+eWFJ9r7C3EjZ09D26MKRnlk6JTm7qeBC7jm/ZMW6/H/U4jmtW5Ni5AdK5vHNEr0QEJtiEbja4wFohlSQG6bRxofHW7k70cCuS8gBp3KZssn2VloJ66W7uSK1k7sA7Mq7sTFNNeKtnX4WYH8v6HrPyXWFZH4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-41b79450f8cso17741795e9.3 for ; Tue, 07 May 2024 00:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1715068796; x=1715673596; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=OfOTBvtloevt20MvLNnSE2TcoKgu/8Mju+uRFbAshWo=; b=FCNg90VXoZmf9rTosEx61CDnfkG8L34xDJlHtZLxgva3y9zsQJc+CfZ0THBdHznG97 kfsASrE2XpV8/QdHqg9AQ57SaYbAkETFsgXGQl93CBW1KB/9u7VXN0/MVAlnPML31c5E IUhao9h8MsHEJtdsCXgwoaGtRpNvO+3NvDsB2JEgAyeiKIIwHUK7qSWb9so24cOcchI0 atSh3LaYMCdROP5oPt6PrmgyktbJOoLF+/5mACe0XX2bu33eOO8h+elLcDcwguUrZoQA ZsX6pnVaJtHj8X2k0QYJk0smAHEJByZFCD90kIDSHBhKMi8B3HHp6A+mU6Dsp6ObQSNw Uu9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715068796; x=1715673596; 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=OfOTBvtloevt20MvLNnSE2TcoKgu/8Mju+uRFbAshWo=; b=BRtvukF95Czc5WKwgWTqS8Zd1bhF+8ZHO0H6cKHxaRiZy2kuxJ9jYQZbdTDzUJx92j VAEUiPWYd6RiLXNKSnTReRMAyTR4sC2bXOZpyobPtvekMgt19AufMm9zYcIYYpYTBKN0 G6dP5Qj7TNiCmskjO3NXu8bgQodPEXI1nKix0Z9aqCP+cBCRYj4wv+O6A8yVqXnazktH h6AHxomMRXolULlVVQrw8OnUUQRxdhYOL3PMB6KFRz7z35ZIAnfNo7ah8l1eU1fTSObQ APziDqNY9T65gbIyVNtfrxpDrWwwyVefw36OQSpNIjaFAE/dsit5D+65XUZ2V0RtvjOU r+jg== X-Gm-Message-State: AOJu0YzMLm0aZP22HvecuijTcJFeLhzBK3sNHEb8h0IS8r+fPF9zMLe5 A5pAKjB4YzVuc0w683W8wqC2cxpJZ9WQg60C8A1liPWkN2UviF9IyD2mPDuMrFU7Ft2S71E44K4 = X-Google-Smtp-Source: AGHT+IEnio+XUgMR2BehQ+ryh54GWr+/67gvTmvwgoRIdkF2SrwCAnvlma3yz+xbrF33cyH0gnvKuA== X-Received: by 2002:a05:600c:4f83:b0:41b:dca6:a3fa with SMTP id n3-20020a05600c4f8300b0041bdca6a3famr9361083wmq.39.1715068796207; Tue, 07 May 2024 00:59:56 -0700 (PDT) Received: from localhost.localdomain ([2001:861:3382:1a90:11a6:1c9d:5099:b1e8]) by smtp.gmail.com with ESMTPSA id t14-20020a05600c450e00b0041bed36e23csm22643931wmo.39.2024.05.07.00.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 00:59:55 -0700 (PDT) From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [COMMITTED] ada: Fix Program_Error raised during generation of data representation in JSON Date: Tue, 7 May 2024 09:59:54 +0200 Message-ID: <20240507075954.36582-1-poulhies@adacore.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.6 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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Eric Botcazou This happens for the extension of a private discriminated tagged type. gcc/ada/ * repinfo.adb (List_Record_Info.List_Structural_Record_Layout): Add another guard for private types after retrieving the parent in the extension case. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/repinfo.adb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/ada/repinfo.adb b/gcc/ada/repinfo.adb index 28a587f039b..28e4a642765 100644 --- a/gcc/ada/repinfo.adb +++ b/gcc/ada/repinfo.adb @@ -1491,6 +1491,12 @@ package body Repinfo is else Parent_Type := Base_Type (Parent_Type); + + if Is_Private_Type (Parent_Type) then + Parent_Type := Full_View (Parent_Type); + pragma Assert (Present (Parent_Type)); + end if; + if not In_Extended_Main_Source_Unit (Parent_Type) then raise Not_In_Extended_Main; end if; -- 2.43.2