[Issue 10897] New: btc, btr and bts shouldn't be safe

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 25 23:55:40 PDT 2013


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

           Summary: btc, btr and bts shouldn't be safe
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2013-08-25 23:55:39 PDT ---
As the title implies, their sig is:
"pure nothrow @safe int btc(size_t* p, size_t bitnum);"

The argument "bitnum" clearly implies array indexing. In this case, there is no
bounds checking, which means the function can't be safe.

Furthermore, they access data in an underhand fashion, potentially corrupting
anything that is passed to them.

Strangely enough, the functions "bt", *is* @system.

In any case, they cannot be made @safe in any way shape or form.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list