[Issue 23900] New: @safe is allowed in inline asm

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 6 16:51:40 UTC 2023


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

          Issue ID: 23900
           Summary: @safe is allowed in inline asm
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: mail at ernestocastellotti.it

DMD allows using @safe in inline ASM, it should be allowed to mark asm only as
@system and @trusted because allowing @safe causes user confusion.

Example code:

void main() @safe {
    asm @safe {
        nop;
    }
}

This shouldn't compile, only @trusted and @system should be allowed because
there is no way to check the safety of asm inline code

--


More information about the Digitalmars-d-bugs mailing list