From patchwork Mon May 15 09:42:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 94043 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6792731vqo; Mon, 15 May 2023 02:49:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5V+yirThJvey8fvUVfTTk82saBsm9WzqE+2BtTG8zH5hmAziTQZ+5GOMtSn81kiToh/BfU X-Received: by 2002:aa7:d919:0:b0:504:89cb:748b with SMTP id a25-20020aa7d919000000b0050489cb748bmr24038641edr.33.1684144185106; Mon, 15 May 2023 02:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684144185; cv=none; d=google.com; s=arc-20160816; b=koRUN3aMlY5q1c5unMsUdpjgPS6bTy4kZOAjL9Jdqj0++QFzkKY98sGczy5FvFRJjE NEFvCr3Bo0zEI8YEgzg+fJjvBVAmUpOt6Zmwm4Ua633bYxb29Nd1YuSmnmWZeTIkHrjy XmYjo/hNwnYr2Slo1GD2+fWZRVMEon7ClQW2uZZe9LvbX0HN6chnmlei9At9+qk7cyFC Lzb8VUhaxOMNX0KYHJFqrtm1gDsvVUwU7yZ5f/m9Ex0Vlf+6Wc1YIq55NJwMH4MhCDJr 4+sIflNHqcRSGb/EXBvgffOsSSgIKPxFPxQzvXgIZg5vOSLlg/XLs5f+v5qQB8xl3sIY 5ukQ== 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=seuHYY+fxi/SjOn15ifv3xzyHreKcFKwWenXUr3zKkk=; b=e7G1pRpyJhb78O/j7TDcCLqGDRVjN/7UBMbPpLtyiZvdeL8YO5ZgTAtGvgfyDH1nCd YISbercnbMaBziTg3Quh8gHiBzc2ju0Fl1az2L5g5in0r7swaBN2gS0vljV/f9bNxnDh JnnlElRDVziPlucIn2W+if5J8/Khr69QLb0e5c9DTM2SzKfTFbE96SGU/b71LL3aPa5B tTGiUao8CH++XIGKnr0y8q1Src4BkHyxaAh37R5ZvnCwvXX2VJA3FhgD0W8dDqBotwBy ubjJzsYCUCqmNLCignfSvm65R6DiVvuVHccLYgfeMI5dEWK2x27u5gW+I597x+40z/HN HP6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=YMn34nnH; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id z22-20020aa7cf96000000b0050d8bf01a68si10850788edx.428.2023.05.15.02.49.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 02:49:45 -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=@gcc.gnu.org header.s=default header.b=YMn34nnH; 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"; 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 36321385416B for ; Mon, 15 May 2023 09:46:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36321385416B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684143967; bh=seuHYY+fxi/SjOn15ifv3xzyHreKcFKwWenXUr3zKkk=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=YMn34nnHlhbX+fnFcfZqcxk45dNrC+4ppht3PvL/dbV2VdQr8YqPiHiPZ4SMZ00bX gBXgdQ4O6hkuxPdPFfyXGT+mnmWLQTxww1ta/lQwo5DPRW2nNva2UD/Eg4YmnYtRVK vAuhjdDIS2b294s/fMMSOZ3QbwJtr9NCOoG7Ohws= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 771143854162 for ; Mon, 15 May 2023 09:42:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 771143854162 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f41dceb9d1so95721465e9.1 for ; Mon, 15 May 2023 02:42:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684143777; x=1686735777; 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=seuHYY+fxi/SjOn15ifv3xzyHreKcFKwWenXUr3zKkk=; b=aCbHkoMRAC5w67D7DEr+tVNxucAPME1jLVoT1Ya5YmWnvpJAPp59liXnnLLB5QFMvR S4Zja9DznzuLLQ4BanIadOCD8AZUf4rKNzkQU8zITm/45waprkYVQKhLQx5JV1vjZP+7 fpPq4AT4nJubV3CFWr96br1E3PCtUJdYjgJgp21w0joFFkX4r+U0xIBxt6WoetV8XL0n VoaPwLq2L8DQJsnMF93ra2Yj3aipODAorNuH+2UKyLGBpBltix8R4jAtcjWSVsYMxRuM OB9OvHPU5yQ/MpqkywxNYa8pZZMcRD99iNloA2/dYapy2Q7hIafFLqC/S6rDuWEtXbEK H6qw== X-Gm-Message-State: AC+VfDwlazRx74IQ4MWPNCTgJ7jKoFa5nj+N5R2yN6wwxTmLQ4PjiHnV GBJh/IYM4lZWUIaadHh7SLg+PkDaztdJq1Gm6RjG6A== X-Received: by 2002:a7b:c855:0:b0:3f4:23e5:5bb0 with SMTP id c21-20020a7bc855000000b003f423e55bb0mr20385845wml.5.1684143777227; Mon, 15 May 2023 02:42:57 -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 w22-20020a1cf616000000b003f080b2f9f4sm36280969wmc.27.2023.05.15.02.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 02:42:56 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: Bob Duff Subject: [COMMITTED] ada: Add Check_Error_Detected before "raise Bad_Attribute" Date: Mon, 15 May 2023 11:42:54 +0200 Message-Id: <20230515094254.1407902-1-poulhies@adacore.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Marc_Poulhi=C3=A8s_via_Gcc-patches?= From: =?utf-8?q?Marc_Poulhi=C3=A8s?= Reply-To: =?utf-8?q?Marc_Poulhi=C3=A8s?= Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765953173018562428?= X-GMAIL-MSGID: =?utf-8?q?1765953173018562428?= From: Bob Duff We shouldn't raise Bad_Attribute if there is no error. This patch adds a call to Check_Error_Detected to make sure that's true. (There are other cases where we raise Bad_Attribute; this patch doesn't try to fix them all.) gcc/ada/ * sem_attr.adb (Analyze_Attribute): Add a call to Check_Error_Detected. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_attr.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 77c56aa587b..9de9884069e 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -3299,6 +3299,7 @@ package body Sem_Attr is -- Check for missing/bad expression (result of previous error) if No (E1) or else Etype (E1) = Any_Type then + Check_Error_Detected; raise Bad_Attribute; end if; end if;