On 11/4/12 1:31 AM, Jonathan M Davis wrote:
I just thought that I should bring greater attention to

http://d.puremagic.com/issues/show_bug.cgi?id=8838

As it stands, I think that the slicing static arrays being considered @safe is
a major hole in SafeD's safety, and I think that it's one that many of us
aren't aware of. But there seems to be some resistance to outright making the
slicing of static arrays @system within that bug report, and I recall similar
resistance in the thread that prompted that bug report (unfortunately, I don't
remember what thread it was - somewhere in D.Learn I think).

So, I was wondering what the general consensus on this was. Should slicing
static arrays be considered @system? I honestly don't see how we could do
otherwise without the compiler being way, way smarter at detecting escaping
references than is ever going to happen.

Also, I really think that if we're agreed that this change needs to be made
that it should then be made sooner rather than later, because it's going to
break code which actually tries to use @safe.

Slicing of static arrays is unsafe only if they're stack-allocated and the slice is subsequently escaped.

Andrei

Reply via email to