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