[Issue 17363] @safety hole due to $ caching in slice expressions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 11 00:47:30 UTC 2018


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

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #4 from Walter Bright <bugzilla at digitalmars.com> ---
The only safe solution is for s[a..b] is to evaluate a and b first, then s.
Then the slice will be array bounds checked safely if it got resized.

(Currently, s is evaluated first.)

--


More information about the Digitalmars-d-bugs mailing list