www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23805] New: Runtime segmentation fault when destructor access

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

          Issue ID: 23805
           Summary: Runtime segmentation fault when destructor access
                    function frame
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: pro.mathias.lang gmail.com

```
void main ()
{
    size_t destructionCount;
    struct CantDestruct {
        int value;
        ~this () { ++destructionCount; }
    }
    static void test(CantDestruct a) {}
    test(CantDestruct.init);
}
```

This crashes with a segfault when running the program.

--
Mar 23 2023