[Issue 21004] New: dmd segmentation fault with 'void' struct member array initializer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 1 21:16:28 UTC 2020


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 at puremagic.com
          Reporter: acehreli at 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

--


More information about the Digitalmars-d-bugs mailing list