www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14699] New: dmd 2.67 segfaults on innocent code

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

          Issue ID: 14699
           Summary: dmd 2.67 segfaults on innocent code
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: tomerfiliba gmail.com

The code crashes both dmd2.66 and 2.67

struct Table(K, V, ushort capacity_) {
    V[capacity_] values;
}

struct Set(K, ushort capacity_) {
    Table!(K, ubyte[0], capacity_) tbl;
}

// this works
Table!(uint, ubyte[0], 10) thisWorks;

// this crashes
Set!(uint, 10) thisCrashesDmd;

void main() {}

The segfault:
Program received signal SIGSEGV, Segmentation fault.
0x00000000005639c0 in dtcat(dt_t**, dt_t*) ()
(gdb) bt


dt_t**)::ExpToDt::visit(ArrayLiteralExp*) ()

dt_t**)::ExpToDt::visit(ArrayLiteralExp*) ()


dt_t**)::ExpToDt::visit(StructLiteralExp*) ()

dt_t**)::ExpToDt::visit(StructLiteralExp*) ()



bool)::ToObjFile::visit(VarDeclaration*) ()




--
Jun 14 2015