https://issues.dlang.org/show_bug.cgi?id=12928

--- Comment #2 from Lionello Lunesu <[email protected]> ---
(In reply to Jonathan M Davis from comment #1)
> On 64-bit Linux with the latest git master, this works perfectly fine for
> me. It throws a RangeError like it's supposed to.

You'll need the very latest to repro the test case,
34d970836b202f71d0a07c4b2a195a405b69bc6d.

Before that commit the compiler didn't know the range of the foreach iterator
and would keep the bounds check. Here's a way to repro on older versions:

void main(string[] args)
{
  int[3] a;
  a[args.length&3] = 2;
}

--

Reply via email to