[OT] OT: Null checks.

Timon Gehr timon.gehr at gmx.ch
Wed May 7 23:10:56 UTC 2025


On 5/8/25 00:02, Walter Bright wrote:
> Next, there's druntime being compiled with `-release`. What does that 
> mean for the array bounds check:
> ```
> void main(){
>       int[2] x=[0,1];
>       auto y=x[1..2];
>       x[]=y[];
> }
> ```
> Compile with -vasm -release -check=on
> ```
> core.exception.RangeError at x.d(4): Range violation

Yes, with DMD this command line works, but it seems LDC still calls into 
a druntime assert(0).

$ ./ldc2-1.41.0-beta1-linux-x86_64/bin/ldmd2 -release -check=on -run test.d
Error: /tmp/test-116bf6 failed with status: -2
        message: Illegal instruction (core dumped)
Error: program received signal 2 (Interrupt)


More information about the Digitalmars-d mailing list