www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 490] New: Static struct initializer without static attribute aborts dmd with assertion

reply d-bugmail puremagic.com writes:
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


-- 
Nov 08 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=490


bugzilla digitalmars.com changed:

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





Fixed DMD 0.175


-- 
Nov 25 2006
prev sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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 -----BEGIN PGP SIGNATURE----- iD8DBQFFjYx3LK5blCcjpWoRAqAmAJ0dBBb8APyJZfUd1109oJGuBE9xxACfWHZU xvG2TtwK8hnsnR8UHv6xn20= =Jrdt -----END PGP SIGNATURE-----
Dec 23 2006