On Friday, 16 December 2011 at 16:43:29 UTC, Jonathan M Davis wrote:
On Friday, December 16, 2011 16:26:11 Christian Manning wrote:
On Wednesday, 14 December 2011 at 07:05:25 UTC, Walter Bright

wrote:
> Highlights are use of XMM floating point registers in 64 bit
> targets, and now supporting OS X 64 as a target.
> > http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.057.zip
> > A lot of people put a ton of effort into making this D's best
> release ever. Thanks!

I found a bug when slicing static arrays. It's not new to 2.057
but I totally forgot about it (my bad) and didn't simplify a test
case.

auto x() {
  ubyte[4] a;
  return a;
}

auto y() {
  return x()[1..$];
}

void main() {
  y();
}

Gives:
Internal error: ..\ztc\cgcs.c 354

Is this known or should I file a bug?

It may bhttp://d.puremagic.com/issues/show_bug.cgi?id=4414

I'd point out though that that is really bad code, which should probably give an error when you try and compile it (though it obviously shouldn't cause the compiler to ICE regardless).

http://d.puremagic.com/issues/show_bug.cgi?id=7087

- Jonathan M Davis

It was just some mess around code, but I'll avoid it in the future, so thanks for pointing it out :)

It does indeed look to be the same problem as http://d.puremagic.com/issues/show_bug.cgi?id=4414 I should also point out that the appearance of the error is dependant on the slice size.

How about this as a better test case?

ubyte[4] a;
auto x() {
   return a;
}
void main() {
   auto b = x()[1..$];
}

Reply via email to