http://d.puremagic.com/issues/show_bug.cgi?id=6153


Matthias Walter <xa...@xammy.info> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xa...@xammy.info


--- Comment #3 from Matthias Walter <xa...@xammy.info> 2012-07-18 03:14:20 PDT 
---
The reason for the failure is that for

arr2D[0].insert(1);

the opIndex() method is invoked which returns by value. In theory this is okay
since the array is stored by reference and the returned value contains a
reference to the payload data of the inner array.

What happens here is that arr2D[0] is uninitialized (the pointer to the
RefCounted object is null) and this guy is returned. It is then changed (the
insert method initializes the temporary and creates the ref-counted object with
the inserted content).

One way to resolve this is to make opIndex return a reference. Or is there an
alternative?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to