[cfe-commits] New files for libcxxabi
Howard Hinnant
hhinnant at apple.com
Wed Jun 8 11:39:43 PDT 2011
On Jun 8, 2011, at 10:32 AM, Marshall Clow wrote:
>
> On Jun 8, 2011, at 9:17 AM, Howard Hinnant wrote:
>
>> On Jun 7, 2011, at 1:15 PM, Marshall Clow wrote:
>>
>>> Implements the new [] and delete [] functionality.
>>> With tests.
>>>
>>> Comments please.
>>> I'm not 100% sure that the exception handling is correct - so that's a good place to look ;-)
>>
>> This is looking pretty good to me. I have one trivial comment (1), and one non-trivial comment (2) that I'd like as many eyes as possible on.
>>
>> Thanks Marshall!
>>
>>
>> 1. test_vector.cpp needs a standard LLVM/banner header.
>>
>> 2. In the catch clause of __cxa_vec_dtor:
>>
>> catch(...) {
>> // if we've caught an exception while doing stack unwinding, then
>> // there's really nothing we can do.
>> if ( std::uncaught_exception ())
>> std::terminate ();
>> // otherwise, attempt to destruct the rest of the array and rethrow
>> __cxa_vec_cleanup ( array_address, idx, element_size, destructor );
>> throw ;
>> }
>>
>> I'm thinking that even if we're in an unwind, we should still attempt __cxa_vec_cleanup:
>>
>> catch(...) {
>> // attempt to destruct the rest of the array and rethrow
>> __cxa_vec_cleanup ( array_address, idx, element_size, destructor );
>> throw ;
>> }
>>
>> However this is admittedly confusing territory. I ran test_vector.cpp both ways, and it passed. Comments?
>
> The sample code at <http://www.codesourcery.com/public/cxx-abi/gcc-vec.cc> has code to check for this case - and I just noticed that I implemented it "incorrectly" (i.e, differently than that). I think that code is clearer about what is going on.
Hmm.. I notice that sample code also does a recursive call to itself, which may be why it is checking for unwinding.
Howard
More information about the cfe-commits
mailing list