www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21004] New: dmd segmentation fault with 'void' struct member

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

          Issue ID: 21004
           Summary: dmd segmentation fault with 'void' struct member array
                    initializer
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: acehreli yahoo.com

Compiling the following code segfaults dmd 2.092.0:

struct S {
  ubyte[1024 * 1024] a = void;
}

void main() {
  version (works) {
    S s;

  } else {
    auto s = S();    // Fails
  }
}

Compile it with `-version=works' and now it compiles fine.

Array size does matter. You may have to use a different size to duplicate.

Perhaps related to https://issues.dlang.org/show_bug.cgi?id=17874

Ali

--
Jul 01