[Issue 13589] [git-head] Asm statement could be assumed to nothrow, safe, pure by the enclosing function attribute

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Oct 8 08:09:09 PDT 2014


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

--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> ---
For the memory safety, asm statement with @trusted attribute is still useful.

void foo(int* p) @safe {
    asm @trusted {/*...*/}   // this is assumed as safe.
    (*p + 1) = 10;  // pointer arithmetic is disallowed in safe code
}

And more, I'd disallow asm @safe {/*...*/} , because we already have the best
attribute @trusted to assume the code as such.

--


More information about the Digitalmars-d-bugs mailing list