Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2013-05-13 Thread Florian Weimer
On 05/06/2013 05:56 PM, Jason Merrill wrote: On 05/06/2013 08:46 AM, Florian Weimer wrote: On 05/06/2013 02:39 PM, Jason Merrill wrote: On 05/06/2013 05:46 AM, Florian Weimer wrote: Nice, this is simpler than expected. However, it makes the call sites even more bloated. Hmm, perhaps the

Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2013-05-06 Thread Florian Weimer
On 05/03/2013 10:24 PM, Jason Merrill wrote: Last year Florian fixed the compiler to detect overflow in array new size calculations and pass (size_t)-1 in that case. But C++11 specifies that in case of overflow the program throws std::bad_array_new_length

Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2013-05-06 Thread Jason Merrill
On 05/06/2013 05:46 AM, Florian Weimer wrote: Nice, this is simpler than expected. However, it makes the call sites even more bloated. Hmm, perhaps the checking should be wrapped in an inline function, so that the inliner can decide whether or not to expand it at the call site... This

Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2013-05-06 Thread Florian Weimer
On 05/06/2013 02:39 PM, Jason Merrill wrote: On 05/06/2013 05:46 AM, Florian Weimer wrote: Nice, this is simpler than expected. However, it makes the call sites even more bloated. Hmm, perhaps the checking should be wrapped in an inline function, so that the inliner can decide whether or not

Re: C++/v3 PATCH to add/throw std::bad_array_new_length

2013-05-06 Thread Jason Merrill
On 05/06/2013 08:46 AM, Florian Weimer wrote: On 05/06/2013 02:39 PM, Jason Merrill wrote: On 05/06/2013 05:46 AM, Florian Weimer wrote: Nice, this is simpler than expected. However, it makes the call sites even more bloated. Hmm, perhaps the checking should be wrapped in an inline

C++/v3 PATCH to add/throw std::bad_array_new_length

2013-05-03 Thread Jason Merrill
Last year Florian fixed the compiler to detect overflow in array new size calculations and pass (size_t)-1 in that case. But C++11 specifies that in case of overflow the program throws std::bad_array_new_length (http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#624), so I've