checkedint call removal

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 2 08:08:33 PDT 2014


On 8/2/14, 5:44 AM, Artur Skawina via Digitalmars-d wrote:
>    auto fx(ubyte* p, size_t len) @safe {
>        assert_(len>0);
>        if (len>=1)
>           return p[0];
>        return -1;
>     }

As an aside I think it's a bug that this function passes @safe. It 
should not be able to safely dereference the pointer because it may be 
e.g. just past the end of the array. Has this been submitted as a bug? 
-- Andrei



More information about the Digitalmars-d mailing list