Classical bug

Fyodor Ustinov via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 27 03:41:19 PST 2015


Hi!

I thought at least in safe mode this code will not compile or I 
get warning:

byte[] func() @safe {
  byte[1024] buffer;
  return buffer[0..3];
}

void main() {
   auto b = func();
   b[0] = 1;
}

But no any error. Dlang do not catch this?

WBR,
     Fyodor.


More information about the Digitalmars-d-learn mailing list