ACE_TAO icon indicating copy to clipboard operation
ACE_TAO copied to clipboard

[Bugzilla 3942] Sequence elements don't work correctly with var types

Open mitza-oci opened this issue 2 years ago • 0 comments

Migrating this from Vanderbilt's Bugzilla http://bugzilla.dre.vanderbilt.edu/show_bug.cgi?id=3942

The bottom line is that sequences of object references don't work the way the spec requires.

Here are the key parts of IDL-to-C++ formal/12-07-02.

In sequences (5.15):

For strings, wide strings, and object references, operator[] for a sequence must return a type with the same semantics as the types used for string, wide string, and object reference members of structs...

In structs (5.12):

Assignment between a string, wide string, or object reference member and a corresponding T_var type (String_var, WString_var, or A_var) always results in copying the data, while assignment with a pointer does not.

This is a bit confusing because of the "copy the data" phrase and trying to describe strings and object references in one clause, but it effectively means that the reference count is increased for member-to-var assignment so that when the var goes out of scope the count is back to where it was before the assignment.

There is a test in TAO/tests/Bug_3942_Regression which has !FIXED_BUGS_ONLY in the test list.

mitza-oci avatar Jan 25 '23 15:01 mitza-oci