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

Dennis <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Dennis <[email protected]> ---
The compiler lowers it to
```
ubyte[] __r3 = array[];
ubyte __key2 = cast(ubyte)0u;
for (; cast(int)__key2 < cast(int)cast(ubyte)__r3.length; cast(int)__key2 += 1)
{
        ref ubyte a = __r3[cast(ulong)__key2];
        const const(ubyte) i = __key2;
        a = i;
}
```
As you can see, the length is cast to a `ubyte`, so it overflows to a length of
0, which is why the loop body isn't entered.

--

Reply via email to