From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25393 invoked by alias); 25 Oct 2013 19:04:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 25376 invoked by uid 89); 25 Oct 2013 19:04:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Oct 2013 19:04:04 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9PJ40xj021058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 25 Oct 2013 15:04:01 -0400 Received: from redhat.com (ovpn-116-32.ams2.redhat.com [10.36.116.32]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r9PJ3uAl005073 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 25 Oct 2013 15:03:59 -0400 Date: Fri, 25 Oct 2013 19:15:00 -0000 From: Marek Polacek To: Jason Merrill Cc: GCC Patches , Jakub Jelinek , "Joseph S. Myers" Subject: Re: [PATCH][ubsan] Add VLA bound instrumentation Message-ID: <20131025190356.GG27400@redhat.com> References: <20130912122655.GN23899@redhat.com> <20130925124132.GJ12296@redhat.com> <52697B9D.9000502@redhat.com> <20131025165803.GF27400@redhat.com> <526AB5CC.60408@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <526AB5CC.60408@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2013-10/txt/msg02201.txt.bz2 On Fri, Oct 25, 2013 at 02:17:48PM -0400, Jason Merrill wrote: > On 10/25/2013 12:58 PM, Marek Polacek wrote: > >I've tried to implement the instrumentation in cp_finish_decl. > >However, the problem is with multidimensional arrays, e.g. for > > > >int x = -1; > >int a[1][x]; > > > >array_of_runtime_bound_p returns false, thus we don't instrument this > >at all, nor throw an exception in c++1y mode... > > Because the above is not valid under the proposed standard C++ VLA > support; only the leftmost bound can be variable. I see. > I think the right place to handle both ubsan and c++1y VLA checks is > in compute_array_index_type, in the block where we're calling > variable_size. I'm sorry, you want me to move the c++1y VLA check into compute_array_index_type, or just do the ubsan instrumentation in there? Thanks, Marek