www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Compiler crash v.108

reply David Medlock <amedlock nospam.org> writes:
I don't know if this is related to Dave's post but the following causes 
a crash in Win2k, DMD .108

struct Header
{
   int xsize, ysize;

   int height() { return ysize; }
   int width()  { return xsize; }
}


void main( char[][] arg )
{
   Header header;
   int total = header.width * header.height;
   ubyte[total]     colors; // color indexed bitmap data
}
Dec 04 2004
parent reply David Medlock <amedlock nospam.org> writes:
David Medlock wrote:
 I don't know if this is related to Dave's post but the following causes 
 a crash in Win2k, DMD .108
 
 struct Header
 {
   int xsize, ysize;
 
   int height() { return ysize; }
   int width()  { return xsize; }
 }
 
 
 void main( char[][] arg )
 {
   Header header;
   int total = header.width * header.height;
   ubyte[total]     colors; // color indexed bitmap data
 }

FYI: Changing colors to a dynamic array doesn't cause the compiler to fault.
Dec 04 2004
parent reply "Simon Buchan" <currently no.where> writes:
On Sat, 04 Dec 2004 12:31:40 -0500, David Medlock <amedlock nospam.org>  
wrote:

 David Medlock wrote:
 I don't know if this is related to Dave's post but the following causes  
 a crash in Win2k, DMD .108
  struct Header
 {
   int xsize, ysize;
    int height() { return ysize; }
   int width()  { return xsize; }
 }
   void main( char[][] arg )
 {
   Header header;
   int total = header.width * header.height;
   ubyte[total]     colors; // color indexed bitmap data
 }

FYI: Changing colors to a dynamic array doesn't cause the compiler to fault.

Hmm, that should complain that total isn't const anyway, shouldn't it? Does on my dmd 1.07 on XP... -- "Unhappy Microsoft customers have a funny way of becoming Linux, Salesforce.com and Oracle customers." - www.microsoft-watch.com: "The Year in Review: Microsoft Opens Up"
Dec 04 2004
parent "Simon Buchan" <currently no.where> writes:
On Sun, 05 Dec 2004 20:52:09 +1300, Simon Buchan <currently no.where>  
wrote:

 On Sat, 04 Dec 2004 12:31:40 -0500, David Medlock <amedlock nospam.org>  
 wrote:

 David Medlock wrote:
 I don't know if this is related to Dave's post but the following  
 causes a crash in Win2k, DMD .108
  struct Header
 {
   int xsize, ysize;
    int height() { return ysize; }
   int width()  { return xsize; }
 }
   void main( char[][] arg )
 {
   Header header;
   int total = header.width * header.height;
   ubyte[total]     colors; // color indexed bitmap data
 }

FYI: Changing colors to a dynamic array doesn't cause the compiler to fault.

Hmm, that should complain that total isn't const anyway, shouldn't it? Does on my dmd 1.07 on XP...

Scratch that, stuffed up the update last time (whoops!) Confirm fails with 1.07, complains 1.06. -- "Unhappy Microsoft customers have a funny way of becoming Linux, Salesforce.com and Oracle customers." - www.microsoft-watch.com: "The Year in Review: Microsoft Opens Up"
Dec 04 2004