Thread overview
[Issue 23805] Runtime segmentation fault when destructor access function frame
Mar 24, 2023
Mathias LANG
Mar 28, 2023
RazvanN
Mar 28, 2023
Dlang Bot
March 24, 2023
https://issues.dlang.org/show_bug.cgi?id=23805

--- Comment #1 from Mathias LANG <pro.mathias.lang@gmail.com> ---
As Steven Schveighoffer pointed out, this is because the context pointer is `null`. So we should probably disable `.init` for nested structures, or find a way to prevent this mistake.

--
March 28, 2023
https://issues.dlang.org/show_bug.cgi?id=23805

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #2 from RazvanN <razvan.nitu1305@gmail.com> ---
Makes sense to me to have it error.

Another incosistency:

void fun(T)()
{
    T a;
}

If `fun` is instantiated with DontDestruct you end up with: "Error: cannot access frame pointer of `test.main.CantDestruct`" at line "T a;". However, if you replace it with `T a = T.init` it compiles. `T a` and `T a = T.init` are exactly the same thing.

--
March 28, 2023
https://issues.dlang.org/show_bug.cgi?id=23805

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@RazvanN7 created dlang/dmd pull request #15046 "Fix Issue 23805 - Runtime segmentation fault when destructor access function frame" fixing this issue:

- Fix Issue 23805 - Runtime segmentation fault when destructor access function frame

https://github.com/dlang/dmd/pull/15046

--