Bug 587 – DMD crashes compiling char[][] initialization

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-11-23T05:42:00Z
Last change time
2014-02-15T13:20:46Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
samuel

Comments

Comment #0 by samuel — 2006-11-23T05:42:02Z
Trying to compile a .d file with this sentence makes DMD 0.174 to crash: char[][] Level2Text = {"LOW", "MEDIUM", "HIGH"}; Probably it's related with the static array initialization issue that was stated in the OSNews C++ thread. Best regards.
Comment #1 by lio+bugzilla — 2006-11-23T08:28:17Z
You should use []: char[][] Level2Text = ["LOW", "MEDIUM", "HIGH"]; But I can confirm the ICE in DMD 0.174 in Windows: parse tt semantic tt semantic2 tt *crash*
Comment #2 by aldacron — 2006-11-23T09:45:14Z
> ------- Comment #1 from [email protected] 2006-11-23 08:28 ------- > You should use []: > char[][] Level2Text = ["LOW", "MEDIUM", "HIGH"]; > > But I can confirm the ICE in DMD 0.174 in Windows: > > parse tt > semantic tt > semantic2 tt > *crash* Could be the same as bug#530. Please try that one, since Bruno couldn't duplicate the behaviour. Actually I even got an ICE with int a=[];
Comment #3 by samuel — 2006-11-23T11:34:14Z
I've tried bug#530 and I can't reproduce it. The compiler complain, but it does not crash. Best regards. P.S: Thank you, with [] instead of {} works, I think I'm mixing too many languages ;-) Don Clugston escribi
Comment #4 by thomas-dloop — 2006-11-25T07:50:53Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-11-23: > http://d.puremagic.com/issues/show_bug.cgi?id=587 > Trying to compile a .d file with this sentence makes DMD 0.174 to crash: > > char[][] Level2Text = {"LOW", "MEDIUM", "HIGH"}; Added to DStress as http://dstress.kuehne.cn/nocompile/a/array_initialization_29_A.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFaDxTLK5blCcjpWoRAly6AKCHml9fQHn8CD1zhBhAn/ZIhiMIEgCeL0qX xDHD21iX+Et51h2VPT9+zGg= =1Ehy -----END PGP SIGNATURE-----
Comment #5 by smjg — 2006-11-25T10:35:18Z
It's the _invalid_ code, using {...}, which causes the ICE.
Comment #6 by matti.niemenmaa+dbugzilla — 2006-12-03T04:03:12Z
Fixed in DMD 0.176.