Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cxx-abi-dev] __cxa_delete{,2,3}(NULL, ...) legal?


  • To: Dennis Handly <dhandly@xxxxxxxxxx>
  • Subject: Re: [cxx-abi-dev] __cxa_delete{,2,3}(NULL, ...) legal?
  • From: Mark Mitchell <mark@xxxxxxxxxxxxxxxx>
  • Date: Sun, 02 Nov 2003 23:08:35 -0800

On Fri, 2003-10-24 at 15:29, Mark Mitchell wrote:
> Scott, Dennis --
> 
> The short answer is that the ABI does not really specify the behavior of
> these functions when the first argument is NULL.
> 
> The G++ runtime does not presently permit the first argument to be NULL.
> Changing that would be OK; it's backwards compatible.
> 
> If there's no objection, we can update the specification to indicate that
> the "array_address" parameter may be NULL.

Since nobody objected, I committed the attached change.

-- 
Mark Mitchell <mark@xxxxxxxxxxxxxxxx>
CodeSourcery, LLC
Index: abi.html
===================================================================
RCS file: /usr/local/Repository/cxx-abi/abi.html,v
retrieving revision 1.72
diff -c -5 -p -r1.72 abi.html
*** abi.html	28 Oct 2003 19:59:03 -0000	1.72
--- abi.html	3 Nov 2003 07:04:32 -0000
*************** extern "C" void __cxa_vec_delete (
*** 3309,3329 ****
  	    size_t element_size,
  	    size_t padding_size,
  	    void (*destructor) ( void *this ) );
  </pre></code></dt>
  <dd>
! Given the (data) address of an array,
! the non-negative size of prefix padding for the cookie,
! and the size of its elements,
! call the given destructor on each element,
! using the cookie to determine the number of elements,
! and then delete the space.
! If the destructor throws an exception,
! rethrow after destroying the remaining elements if possible.
! If the destructor throws a second exception, call <code>terminate()</code>.
! If padding_size is 0, the destructor pointer must be NULL.
! If the destructor pointer is NULL,
  no destructor call is to be made.
  </dd>
  
  <dt><code><pre>
  extern "C" void __cxa_vec_delete2 (
--- 3309,3327 ----
  	    size_t element_size,
  	    size_t padding_size,
  	    void (*destructor) ( void *this ) );
  </pre></code></dt>
  <dd>
! If the <code>array_address</code> is <code>NULL</code>, return
! immediately.  Otherwise, given the (data) address of an array, the
! non-negative size of prefix padding for the cookie, and the size of
! its elements, call the given destructor on each element, using the
! cookie to determine the number of elements, and then delete the space.
! If the destructor throws an exception, rethrow after destroying the
! remaining elements if possible.  If the destructor throws a second
! exception, call <code>terminate()</code>.  If padding_size is 0, the
! destructor pointer must be NULL.  If the destructor pointer is NULL,
  no destructor call is to be made.
  </dd>
  
  <dt><code><pre>
  extern "C" void __cxa_vec_delete2 (
*************** unwind table location.
*** 4909,4926 ****
  <p>This version of this document is $Revision: 1.72 $.  No special
  significance should be attached to the form of the revision number; it
  is simply a identifying number.</p>
  
  <p>
  <font color=blue>[030905]</font>
  Specify the behavior of <code>__cxa_vec_new</code>,
  <code>__cxa_vec_new2</code>, and <code>__cxa_vec_new3</code> in the
  event that the allocation function returns <code>NULL</code>.
  
  <p>
  <font color=blue>[030609]</font>
! Use <code>void*<code> instead of <code>dso_handle</code>.
  
  <p>
  <font color=blue>[030518]</font>
  Specify behavior of <code>__cxa_vec_new2</code> and
  <code>__cxa_vec_new3</code> when the deallocation function throws an
--- 4907,4929 ----
  <p>This version of this document is $Revision: 1.72 $.  No special
  significance should be attached to the form of the revision number; it
  is simply a identifying number.</p>
  
  <p>
+ <font color=blue>[031102]</font>
+ Specify the behavior of <code>__cxa_vec_delete</code> when the
+ <code>array_address</code> is <code>NULL</code>.
+ 
+ <p>
  <font color=blue>[030905]</font>
  Specify the behavior of <code>__cxa_vec_new</code>,
  <code>__cxa_vec_new2</code>, and <code>__cxa_vec_new3</code> in the
  event that the allocation function returns <code>NULL</code>.
  
  <p>
  <font color=blue>[030609]</font>
! Use <code>void*</code> instead of <code>dso_handle</code>.
  
  <p>
  <font color=blue>[030518]</font>
  Specify behavior of <code>__cxa_vec_new2</code> and
  <code>__cxa_vec_new3</code> when the deallocation function throws an