[Issue 16526] @safe code should do null check for members when appropriate

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Sep 22 09:01:17 PDT 2016


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

Sobirari Muhomori <dfj1esp02 at sneakemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86                         |All
                 OS|Mac OS X                    |All

--- Comment #1 from Sobirari Muhomori <dfj1esp02 at sneakemail.com> ---
struct S
{
    byte[3000] a,b;
}
void f(ref S s)
{
    g(s.b);
}
void g(ref byte[3000] b)
{
    b[2000]=0;
}

Similar with slicing:
void f(ref byte[6000] a)
{
    g(a[0..3000]);
}
void g(ref byte[3000] b)
{
    b[2000]=0;
}

--


More information about the Digitalmars-d-bugs mailing list