[Issue 8722] foreach triggers a floating point exception with multidimensional array of a dimension equal to 0

2013-11-25 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=8722


monarchdo...@gmail.com changed:

   What|Removed |Added

   Keywords||ice
 OS/Version|All |Windows


--- Comment #4 from monarchdo...@gmail.com 2013-11-25 02:04:35 PST ---
(In reply to comment #3)
 Can anyone reproduce?

This is still failing for me (win32, 2.064.2). I assume you tried Linux 64?

I'm getting a dmd crash: Unhandled exception at 0x0053d9e6 in dmd.exe:
0xC094: Integer division by zero.
So this is now an ICE for me.

I don't have a development environment here, so I can't tell which line is
actually doing this.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 8722] foreach triggers a floating point exception with multidimensional array of a dimension equal to 0

2013-11-25 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=8722



--- Comment #5 from yebblies yebbl...@gmail.com 2013-11-25 21:08:53 EST ---
(In reply to comment #4)
 (In reply to comment #3)
  Can anyone reproduce?
 
 This is still failing for me (win32, 2.064.2). I assume you tried Linux 64?
 

Nope, win32 with 2.065 master.  Please have a go with the latest master if you
can.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 8722] foreach triggers a floating point exception with multidimensional array of a dimension equal to 0

2013-11-25 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=8722


monarchdo...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #6 from monarchdo...@gmail.com 2013-11-25 02:33:35 PST ---
(In reply to comment #5)
 (In reply to comment #4)
  (In reply to comment #3)
   Can anyone reproduce?
  
  This is still failing for me (win32, 2.064.2). I assume you tried Linux 64?
  
 
 Nope, win32 with 2.065 master.  Please have a go with the latest master if you
 can.

It indeed works with DMD v2.065 DEBUG.

I guess I'll close this then.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 8722] foreach triggers a floating point exception with multidimensional array of a dimension equal to 0

2013-11-24 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=8722


yebblies yebbl...@gmail.com changed:

   What|Removed |Added

 CC||yebbl...@gmail.com


--- Comment #3 from yebblies yebbl...@gmail.com 2013-11-25 00:23:31 EST ---
Can anyone reproduce?

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 8722] foreach triggers a floating point exception with multidimensional array of a dimension equal to 0

2012-09-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8722



--- Comment #1 from Christopher Crouzet blo...@hotmail.com 2012-09-25 
02:10:09 PDT ---
Did I really write too be...? Where's the edit button!? :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 8722] foreach triggers a floating point exception with multidimensional array of a dimension equal to 0

2012-09-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8722


monarchdo...@gmail.com changed:

   What|Removed |Added

 CC||monarchdo...@gmail.com


--- Comment #2 from monarchdo...@gmail.com 2012-09-25 02:26:59 PDT ---
Additional information:

The first example makes my dmd 2.060 crash actually (!)

Note that the two examples are not *strictly* equivalent, as
foreach(element)
will make a copy of each element, whereas:
foreach ( i; 0 .. array.length )
  whatever( array[i] )
Will access each element by reference.

Changing the first code snippet to:

//-
void whatever( T )( in ref T array )
{
  static if ( isArray!( T ) )
foreach ( ref element; array ) //HERE: REF
  whatever( element );
}


void main()
{
  int[0][2][3] array;
  whatever( array );
}
//-

Works.

Either way, there is something wrong in there, if dmd is crashing. Besides, the
code is legit, and should not produce a floating point exception either.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---