Thread overview
[Issue 13060] @nogc reading an associative array
Jul 02, 2017
Vladimir Panteleev
Jun 30, 2019
Basile-z
Mar 21, 2020
Basile-z
Oct 22, 2022
Luís Ferreira
Oct 22, 2022
Dlang Bot
Oct 24, 2022
Dlang Bot
July 16, 2014
https://issues.dlang.org/show_bug.cgi?id=13060

hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh@quickfur.ath.cx

--
July 02, 2017
https://issues.dlang.org/show_bug.cgi?id=13060

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86                         |All
                 OS|Windows                     |All

--- Comment #1 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
If the index is not in the AA, then a RangeError is thrown. The error is currently allocated on the GC heap.

The "in" operator is @nogc, though.

--
June 30, 2019
https://issues.dlang.org/show_bug.cgi?id=13060

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |b2.temp@gmx.com
         Resolution|---                         |WONTFIX

--- Comment #2 from Basile-z <b2.temp@gmx.com> ---
I thought this could be closed because of -dip1008 but that doesn't work
either.
I suppose it's because druntime is not compiled with -dip1008.

Anyway this issue must be closed because druntime gives the security of range checking and this comes to the price of allocating exception. This is not a special little case that can be fixed with a workaround.

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

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|b2.temp@gmx.com             |

--
October 22, 2022
https://issues.dlang.org/show_bug.cgi?id=13060

Luís Ferreira <contact@lsferreira.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |contact@lsferreira.net
         Resolution|WONTFIX                     |---

--- Comment #3 from Luís Ferreira <contact@lsferreira.net> ---
(In reply to Vladimir Panteleev from comment #1)
> If the index is not in the AA, then a RangeError is thrown. The error is currently allocated on the GC heap.
> 
> The "in" operator is @nogc, though.

This is not true. I think it never was, but, at least, right now, the RangeError is statically allocated on thread-local storage. And this is a bounds check, the same as normal array indexing.

--
October 22, 2022
https://issues.dlang.org/show_bug.cgi?id=13060

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

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

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ljmf00 created dlang/dmd pull request #14585 "fix(nogc): associative array indexing may only cause GC allocation no assignment" fixing this issue:

- fix(nogc): associative array indexing may only cause GC allocation no
assignment

  Fix issue 13060.

  Signed-off-by: Luís Ferreira <contact@lsferreira.net>

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

--
October 24, 2022
https://issues.dlang.org/show_bug.cgi?id=13060

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14585 "fix(nogc): associative array indexing may only cause GC allocation on assignment" was merged into master:

- 6c0eeaad82b6aa6e6e5fbb6c0b4862396127fb40 by Luís Ferreira:
  fix(nogc): associative array indexing may only cause GC allocation no
assignment

  Fix issue 13060.

  Signed-off-by: Luís Ferreira <contact@lsferreira.net>

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

--