Thread overview
[Issue 20505] [DIP1000] Static array allows to escape references to stack variables
Jan 15, 2020
Mathias LANG
Mar 21, 2020
Walter Bright
Mar 21, 2020
Walter Bright
Mar 21, 2020
Walter Bright
Mar 21, 2020
Mathias LANG
Mar 22, 2020
Walter Bright
Feb 18, 2021
Mathias LANG
Aug 27, 2021
Dennis
January 15, 2020
https://issues.dlang.org/show_bug.cgi?id=20505

Mathias LANG <pro.mathias.lang@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[DIP1000] Static array      |[DIP1000] Static array
                   |allows to escape            |allows to escape references
                   |refewrences to stack        |to stack variables
                   |variables                   |

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=20505

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=17764

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=20505

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
The problem is the line `foo(arr)` where `scope char[][2] arr` is converted to `scope char[][]`. This conversion should not be allowed, as it loses the scope-ness of the second level of indirection.

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=20505

--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> ---
This is illustrated by the following code:

  @safe void bar() {
    char[128] a;
    char[][2] arr = [a, a];
    char[][] a2 = arr; // should be error
    return a2[0];      // oops
  }

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=20505

--- Comment #3 from Mathias LANG <pro.mathias.lang@gmail.com> ---
*** Issue 20691 has been marked as a duplicate of this issue. ***

--
March 22, 2020
https://issues.dlang.org/show_bug.cgi?id=20505

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
https://github.com/dlang/dmd/pull/10951

--
February 18, 2021
https://issues.dlang.org/show_bug.cgi?id=20505

Mathias LANG <pro.mathias.lang@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |outland.karasu@gmail.com

--- Comment #5 from Mathias LANG <pro.mathias.lang@gmail.com> ---
*** Issue 21220 has been marked as a duplicate of this issue. ***

--
August 27, 2021
https://issues.dlang.org/show_bug.cgi?id=20505

Dennis <dkorpel@live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dkorpel@live.nl
         Resolution|---                         |FIXED

--- Comment #6 from Dennis <dkorpel@live.nl> ---
Fixed by https://github.com/dlang/dmd/pull/10951 which targeted duplicate issue 21220 instead of this one

--