From patchwork Mon Mar 4 21:22:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 224839 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D77562C02AC for ; Tue, 5 Mar 2013 08:22:54 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1363036975; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=KmNUMFGouu3gnBRbgj/h xgb8kJs=; b=DAKsBhme2ZRm91KhoYRWylLjYPhWMv/rYmYAzMnY9/zJgFvobgga j5/lL9prK9gFGSN5g2w2oaCAbR9ONqEmjbyDlfalSshoQt7t2SuJG8dvsK29xuaw hW+ZfJOjbfBD2nbIgxDv3uV1Gs+8uYcsRaNOj+GBxwUDwV0bLREb5Vo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=HmjFsAE6BzZRtsFIdHwlnc4e2HucvwRmmuuu/PTc04L/rxQwex9wfm6nBSwD+L P9ESYiYHIOZn4bUrvHzNNjr4sUghpoLPyTviPm42UHowtX8wSxAPZ0xsbeJPAfGQ 5Ncyj7uL1XAbKs0w2lTd2i6LNOF1UVE/HGcLAXUyzlfAc=; Received: (qmail 29936 invoked by alias); 4 Mar 2013 21:22:49 -0000 Received: (qmail 29927 invoked by uid 22791); 4 Mar 2013 21:22:48 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 04 Mar 2013 21:22:43 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r24LMgql028017 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 4 Mar 2013 16:22:43 -0500 Received: from zalov.cz (vpn1-7-229.ams2.redhat.com [10.36.7.229]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r24LMfmS023894 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Mar 2013 16:22:42 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.cz (8.14.5/8.14.5) with ESMTP id r24LMedq003560; Mon, 4 Mar 2013 22:22:40 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r24LMejl003559; Mon, 4 Mar 2013 22:22:40 +0100 Date: Mon, 4 Mar 2013 22:22:40 +0100 From: Jakub Jelinek To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix cp_parser_braced_list Message-ID: <20130304212240.GZ12913@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi! As reported by valgrind, cp_parser_braced_list doesn't initialize *non_constant_p when seeing just {}, and thus when e.g. cp_parser_condition calls it, non_constant_p is uninitialized when cp_finish_decl is called with !non_constant_p. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2013-03-04 Jakub Jelinek * parser.c (cp_parser_braced_list): For {} initialize *non_constant_p to false. Jakub --- gcc/cp/parser.c.jj 2013-02-14 09:37:16.000000000 +0100 +++ gcc/cp/parser.c 2013-03-04 19:14:00.629442603 +0100 @@ -17854,6 +17854,8 @@ cp_parser_braced_list (cp_parser* parser if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA)) cp_lexer_consume_token (parser->lexer); } + else + *non_constant_p = false; /* Now, there should be a trailing `}'. */ cp_parser_require (parser, CPP_CLOSE_BRACE, RT_CLOSE_BRACE); TREE_TYPE (initializer) = init_list_type_node;