www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23529] New: [ICE] Compiler segfaults on static array cast

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

          Issue ID: 23529
           Summary: [ICE] Compiler segfaults on static array cast
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: uplink.coder googlemail.com

Currently the compiler will segfault because of an internal null pointer which
is not checked against.

static assert(!__traits(compiles, ()
{
    char[24] x;
    int myNumber = 4;
    return cast(char[4]) (x[myNumber .. myNumber + 4]);
} ()));

--
Nov 30 2022