← Back to index
|
Original Bugzilla link
Bug 54 – Compiler segfault on zero length static array
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-03-16T05:27:00Z
Last change time
2014-02-15T02:09:52Z
Keywords
ice-on-valid-code
Assigned to
bugzilla
Creator
oskar.linde
Comments
Comment #0
by oskar.linde — 2006-03-16T05:27:16Z
template declare(X) { X declare; } typeof(declare!(int[0]).ptr[0]) y; Segfaults DMD.
Comment #1
by oskar.linde — 2006-03-16T08:32:07Z
Here's another version: template declare(X) { X declare; } typeof(declare!(typeof(""))[0..$]) y;
Comment #2
by thomas-dloop — 2006-03-19T01:45:25Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
[email protected]
schrieb am 2006-03-16: > Here's another version: > > template declare(X) { X declare; } > typeof(declare!(typeof(""))[0..$]) y; Added to DStress as
http://dstress.kuehne.cn/run/t/typeof_08_A.d
http://dstress.kuehne.cn/run/t/typeof_08_B.d
http://dstress.kuehne.cn/run/t/typeof_08_C.d
http://dstress.kuehne.cn/run/t/typeof_08_D.d
Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFEHQIl3w+/yD4P9tIRAisSAKChxbZhfqWo2QCVmdqCoZbeHYLTnACfUPGy mc8ksvxf0oHas1xlWegDBjk= =+92v -----END PGP SIGNATURE-----
Comment #3
by thomas-dloop — 2006-03-19T01:45:28Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
[email protected]
schrieb am 2006-03-16: > template declare(X) { X declare; } > typeof(declare!(int[0]).ptr[0]) y;
http://www.digitalmars.com/d/declaration.html#type
# typeof ( Expression ) # Expression is not evaluated, just the type of it is generated Thus Oscar is right in classifying this as "ice-on-valid-code". Added to DStress as
http://dstress.kuehne.cn/run/t/typeof_09_A.d
http://dstress.kuehne.cn/run/t/typeof_09_B.d
http://dstress.kuehne.cn/run/t/typeof_09_C.d
http://dstress.kuehne.cn/run/t/typeof_09_D.d
http://dstress.kuehne.cn/run/t/typeof_09_E.d
http://dstress.kuehne.cn/run/t/typeof_09_F.d
http://dstress.kuehne.cn/run/t/typeof_09_G.d
http://dstress.kuehne.cn/run/t/typeof_09_H.d
Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFEHQhW3w+/yD4P9tIRAutWAJsHWipS14VRiooPuCaxzxZ//hTGXACgkYPk zF3pUbn9gB3eMil9F+fw0Lo= =k0Tx -----END PGP SIGNATURE-----
Comment #4
by bugzilla — 2006-05-25T04:17:24Z
Fixed 0.158