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?

Howard

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to