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

ag0aep6g <[email protected]> changed:

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

--- Comment #1 from ag0aep6g <[email protected]> ---
Reduced:

----
int[1] a13 = [13];
int[1] a42 = [42];
int[] slice;
size_t foo()
{
    slice = a42[];
    return 0;
}
int main()
{
    slice = a13[];
    return slice[foo()];
}
----

With `-boundscheck=off`, the program returns 13. With bounds checking, it
returns 42.

Looks like `-boundscheck` affects the order of evaluation.

--

Reply via email to