November 03, 2022
https://issues.dlang.org/show_bug.cgi?id=15718

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |WONTFIX

--- Comment #1 from RazvanN <razvan.nitu1305@gmail.com> ---
What happens here is that you are creating a delegate that receives some stack pointers. When the delegate is actually called it ends up modifying an expired stack frame (which coincidentally points to the current frame).

Although this is problematic, I would argue that it is a code problem, not a compiler one. What should the compiler be doing here? I guess that in @safe code it should not allow the references to a, b, and c escape the scope of test1. However, this bug report already exists: https://issues.dlang.org/show_bug.cgi?id=23438 .

I will close this as WONTFIX because this system code is ok from a compiler perspective.

--