From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A14B538515D2 for ; Tue, 24 May 2022 12:40:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A14B538515D2 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-554-u3SnbqtCMXG6dBSBnHMuNA-1; Tue, 24 May 2022 08:40:52 -0400 X-MC-Unique: u3SnbqtCMXG6dBSBnHMuNA-1 Received: by mail-qk1-f200.google.com with SMTP id bj2-20020a05620a190200b005084968bb24so13370458qkb.23 for ; Tue, 24 May 2022 05:40:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=US7/z/pKFNWBT7Kz4LyQoRs8gnJXXa/wHWjAOusMpSw=; b=u9o2+G2X7qazxrnHB572qncLqAEm64NpWaOAGtizERc2iE+V3RE5zycBss2L4bgICh C5+cdbO8j8RZZF0eA1aasyX8wlHjIhObLmqUaU7V2rgY3Ga5Jil4KIo2QR+m+F1qbcOv 5t2GirSQ7YHKmUGzuOQiXA6Js7F2UC+1F4efcyEAekOUGUSr91cf5VDKICvUCcWGk5jl sswtDHFiUoa9oQPBeCVQ91+f423CA8M/EJ9/oUed5x3Yx7TJTQXOUMqaTVQvgFTvpFQB 9W+s0gXr+mVZHlC79mZwKBEwXWTS59LpkH3+E/CrqF3u0lSGZLM/RhTUzoc0BVpQc0ek lnIA== X-Gm-Message-State: AOAM532MjK1427eUY/cl9meVHwIinjkr0AYVh8VnXbxD5+oWMW//APKI AlkkbldsXuZ70MkYfs9CBjQd3zT9BeN/Av5ISeVnpfijIOksPKQAO1E/LCdqJWYL6aM1hJCYPeY DIieFjAJ06YRLsVLpYA== X-Received: by 2002:a05:6214:108a:b0:461:cb62:d2e5 with SMTP id o10-20020a056214108a00b00461cb62d2e5mr20588069qvr.84.1653396051703; Tue, 24 May 2022 05:40:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVUEemyrIUZcfO9IWXVPNVhIrEo8vD6zGoWDYKC6nfiZZMDEn/QwryObMH4XfBwuuBuoOJPA== X-Received: by 2002:a05:6214:108a:b0:461:cb62:d2e5 with SMTP id o10-20020a056214108a00b00461cb62d2e5mr20588057qvr.84.1653396051526; Tue, 24 May 2022 05:40:51 -0700 (PDT) Received: from redhat.com ([2601:184:4780:4310::9979]) by smtp.gmail.com with ESMTPSA id br11-20020a05622a1e0b00b002f39b99f6acsm6006382qtb.70.2022.05.24.05.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 05:40:51 -0700 (PDT) Date: Tue, 24 May 2022 08:40:49 -0400 From: Marek Polacek To: Prathamesh Kulkarni Cc: GCC Patches , Jason Merrill Subject: Re: [PATCH] c++: fix ICE on invalid attributes [PR96637] Message-ID: References: <20220429141233.41897-1-polacek@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.2.1 (2022-02-19) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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-List-Received-Date: Tue, 24 May 2022 12:40:54 -0000 On Tue, May 24, 2022 at 05:29:56PM +0530, Prathamesh Kulkarni wrote: > On Fri, 29 Apr 2022 at 19:44, Marek Polacek via Gcc-patches > wrote: > > > > This patch fixes crashes with invalid attributes. Arguably it could > > make sense to assert seen_error() too. > > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk = GCC 13? > > > > PR c++/96637 > > > > gcc/ChangeLog: > > > > * attribs.cc (decl_attributes): Check error_mark_node. > > > > gcc/cp/ChangeLog: > > > > * decl2.cc (cp_check_const_attributes): Check error_mark_node. > > > > gcc/testsuite/ChangeLog: > > > > * g++.dg/parse/error64.C: New test. > > --- > > gcc/attribs.cc | 3 +++ > > gcc/cp/decl2.cc | 2 ++ > > gcc/testsuite/g++.dg/parse/error64.C | 4 ++++ > > 3 files changed, 9 insertions(+) > > create mode 100644 gcc/testsuite/g++.dg/parse/error64.C > > > > diff --git a/gcc/attribs.cc b/gcc/attribs.cc > > index b219f878042..ff157dcf81c 100644 > > --- a/gcc/attribs.cc > > +++ b/gcc/attribs.cc > > @@ -700,6 +700,9 @@ decl_attributes (tree *node, tree attributes, int flags, > > in the same order as in the source. */ > > for (tree attr = attributes; attr; attr = TREE_CHAIN (attr)) > > { > > + if (attr == error_mark_node) > > + continue; > Not a comment on the patch specifically, but just wondering if it'd be > better to use error_operand_p, > than testing against error_mark_node explicitly ? Not here, I don't think; it tests more than is needed here. Marek