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 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.
Jason