www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 587] New: DMD crashes compiling char[][] initialization

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=587

           Summary: DMD crashes compiling char[][] initialization
           Product: D
           Version: 0.174
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: samuel jxdesigner.com


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.


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






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*


-- 
Nov 23 2006
parent reply Don Clugston <dac nospam.com.au> writes:

 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*
duplicate the behaviour. Actually I even got an ICE with int a=[];
Nov 23 2006
parent Samuel MV <samuel jxdesigner.com> writes:

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ó:

 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*
duplicate the behaviour. Actually I even got an ICE with int a=[];
Nov 23 2006
prev sibling next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----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-----
Nov 25 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=587


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com
           Keywords|ice-on-valid-code           |ice-on-invalid-code





It's the _invalid_ code, using {...}, which causes the ICE.


-- 
Nov 25 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=587


deewiant gmail.com changed:

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





Fixed in DMD 0.176.


-- 
Dec 03 2006