Bug 490 – Static struct initializer without static attribute aborts dmd with assertion

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-11-08T19:17:00Z
Last change time
2014-02-15T13:21:49Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
tom_dlang

Comments

Comment #0 by tom_dlang — 2006-11-08T19:17:02Z
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
Comment #1 by bugzilla — 2006-11-25T04:03:59Z
Fixed DMD 0.175
Comment #2 by thomas-dloop — 2006-12-23T15:25:37Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] 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-----