Re: [sv-ec] [SystemVerilog Errata 00000025] Pass by reference behavior of dynamically allocated objects

From: Neil Korpusik <Neil.Korpusik@Sun.com>
Date: Sat Nov 06 2004 - 20:27:24 PST

A proposal for errata 25 was added to the database. A copy of the proposal
is shown below.

Neil

Section 4.6.1 new[]

ADD

When new is called to re-size an existing dynamic array, elements are added or
removed. When the size is increased, additional array elements are added. When
the size is decreased, existing array elements are removed. Elements that have
been removed from a dynamic array may still be in use by tasks or functions
that were called with pass by reference for those elements (10.4.2). Existing
elements of a dynamic array continue to be part of a dynamic array after it
has been re-sized unless the new size of the dynamic array requires them to be
removed.

Section 10.4.2 Pass by reference

ADD (after the paragraph that starts with - "When the argument is passed by
reference, both the caller and the subroutine share the same representation...")

Elements of dynamic arrays, queues and associative arrays that are passed by
reference may get removed from the array before the called function or task
completes. The specific array element passed by reference will continue to
exist within the scope of the called task or function until it completes.
Changes made to the values of array elements by the called task or function
will not be reflected in the array if the element was removed from the array
before the changes were made.

-- 
---------------------------------------------------------------------
Neil Korpusik                                     Tel: 408-720-4852
Member of Technical Staff                         Fax: 408-720-4850
Frontend Technologies - ASICs & Processors (FTAP)
Sun Microsystems
email: neil.korpusik@sun.com
---------------------------------------------------------------------
Received on Sat Nov 6 20:27:27 2004

This archive was generated by hypermail 2.1.8 : Sat Nov 06 2004 - 20:27:50 PST