www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18800] New: [REG2.080.0-beta.1] Array.length setter segfaults

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

          Issue ID: 18800
           Summary: [REG2.080.0-beta.1] Array.length setter segfaults for
                    payloads with indirections
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: sludwig outerproduct.org

---
import std.container.array;

struct S { void* p; }
void main()
{
    Array!S a;
    a.length = 10; // segfault
}
---

The code uses `_payload.sizeof` instead of `_payload.length*T.sizeof`

--
Apr 26 2018