[Issue 6178] Struct inside the AA are not init correctly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 16 02:18:59 PST 2013


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



--- Comment #15 from Maxim Fomin <maxim at maxim-fomin.ru> 2013-01-16 02:18:45 PST ---
(In reply to comment #14)
> This is shitty but I'll use -release for the moment. BTW it seems 
> to require both module with struct  *and* the one where AA is used to be
> compiled wiht -release.

Than this a part of a bigger shit.

/* Known as a problem of filling newly created space of AA array
   with T.init before assigning actual object.
   If operation is interrupted, this leads to AA array containing
   "orphan" T.init objects by no reason. Was reported in BZ.
*/
import std.stdio;

int foo()
{
    throw new Exception("");
}

int[int] array;

void main()
{
    try
    {
        array[1] = foo();
    }
    catch(Exception e)
    {

    }
    writeln(array);
}

Compiling with -O => [1:0]
Compiling with -release => []
Compiling with -noboundscheck => []

So, it appears that there is not only bug with AA assignment, but the bug
depends on compiler options.

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


More information about the Digitalmars-d-bugs mailing list