[cxx-abi-dev] N3639 (arrays of runtime bound): __cxa_bad_array_length

Richard Smith richardsmith at google.com
Fri May 10 19:47:10 UTC 2013


On Mon, Apr 22, 2013 at 4:26 PM, Dennis Handly <dhandly at cup.hp.com> wrote:

> >From: Richard Smith <richardsmith at google.com>
> >N3639, which was voted into the C++14 committee draft today, adds a
> >std::bad_array_length exception which an implementation is required to
> >throw if the computed bound for a VLA ("array of runtime bound") is
> >"erroneous".
> > - bound <= 0
> > - bound > some implementation-defined limit
> > - bound < number of initializers provided
>
> >I propose we don't try to encode what went wrong and just use
> >  extern "C" void __cxa_throw_bad_array_length();
>
> Any reason we don't try to pass in one of the above three?
> Do we want to enable a useful what() string?
>

Consistency with __cxa_throw_bad_array_new_length, simplicity of
implementation, slightly reduced code size.


> >From: Florian Weimer <fweimer at redhat.com>
> >Do we want to throw an exception if the stack hasn't got sufficient
> >space for the array?
>
> Or is this just some "small" implementation-defined limit that is mentioned
> in N3639?
>
> I assume this limit is really based on total size and not on a bound?
>

The limit is implementation-defined, which I interpret to mean that we can
do whatever we like, so long as we document what we do.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/cxx-abi-dev/attachments/20130510/2eb88452/attachment.html>


More information about the cxx-abi-dev mailing list