587 – DMD crashes compiling char[][] initialization

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 587 - DMD crashes compiling char[][] initialization
Summary: DMD crashes compiling char[][] initialization
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
Reported: 2006年11月23日 05:42 UTC by Samuel Martin Valentin
Modified: 2014年02月15日 13:20 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Samuel Martin Valentin 2006年11月23日 05:42:02 UTC
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 Lionello Lunesu 2006年11月23日 08:28:17 UTC
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 Mike Parker 2006年11月23日 09:45:14 UTC
> ------- Comment #1 from lio@lunesu.com 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 Samuel Martin Valentin 2006年11月23日 11:34:14 UTC
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 Thomas Kühne 2006年11月25日 07:50:53 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
d-bugmail@puremagic.com 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 Stewart Gordon 2006年11月25日 10:35:18 UTC
It's the _invalid_ code, using {...}, which causes the ICE.
Comment 6 Matti Niemenmaa 2006年12月03日 04:03:12 UTC
Fixed in DMD 0.176.


AltStyle によって変換されたページ (->オリジナル) /