Thread overview
[Issue 587] New: DMD crashes compiling char[][] initialization
Nov 23, 2006
d-bugmail
Nov 23, 2006
d-bugmail
Nov 23, 2006
Don Clugston
Nov 23, 2006
Samuel MV
Nov 25, 2006
Thomas Kuehne
Nov 25, 2006
d-bugmail
Dec 03, 2006
d-bugmail
November 23, 2006
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.


-- 

November 23, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=587





------- 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*


-- 

November 23, 2006
> ------- 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=[];
November 23, 2006
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 #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=[];
November 25, 2006
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


November 25, 2006
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




------- Comment #5 from smjg@iname.com  2006-11-25 10:35 -------
It's the _invalid_ code, using {...}, which causes the ICE.


-- 

December 03, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=587


deewiant@gmail.com changed:

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




------- Comment #6 from deewiant@gmail.com  2006-12-03 04:03 -------
Fixed in DMD 0.176.


--