Thread overview
[Issue 490] New: Static struct initializer without static attribute aborts dmd with assertion
Nov 09, 2006
d-bugmail
Nov 25, 2006
d-bugmail
Dec 23, 2006
Thomas Kuehne
November 09, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=490

           Summary: Static struct initializer without static attribute
                    aborts dmd with assertion
           Product: D
           Version: 0.173
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: chievo3@gmail.com


public struct S
{
        int a, b;
}

void main() {
        S s= {1, 2}; // DMD fails to throw an error and aborts.
        S q= {a:1, b:2}; // Idem.

        static S r= {1, 2}; // OK.
        static S t= {a:1, b:2}; // OK.
}

DMD says:
dmd: init.c:219: virtual Expression* StructInitializer::toExpression():
Assertion `0' failed.
Aborted


-- 

November 25, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=490


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from bugzilla@digitalmars.com  2006-11-25 04:03 -------
Fixed DMD 0.175


-- 

December 23, 2006
d-bugmail@puremagic.com schrieb am 2006-11-09:
> http://d.puremagic.com/issues/show_bug.cgi?id=490

> public struct S
> {
>         int a, b;
> }
>
> void main() {
>         S s= {1, 2}; // DMD fails to throw an error and aborts.
>         S q= {a:1, b:2}; // Idem.
>
>         static S r= {1, 2}; // OK.
>         static S t= {a:1, b:2}; // OK.
> }
>
> DMD says:
> dmd: init.c:219: virtual Expression* StructInitializer::toExpression():
> Assertion `0' failed.
> Aborted

Added to DStress as http://dstress.kuehne.cn/nocompile/s/struct_initialization_09_A.d http://dstress.kuehne.cn/nocompile/s/struct_initialization_09_B.d

Thomas