[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 09:38:36 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13589
--- Comment #8 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to yebblies from comment #7)
> (In reply to Kenji Hara from comment #6)
> >
> > void f3() @safe pure {
> > asm {...}
> > // f3 has explicit @safe attribute, so asm is inferred as @trusted, pure,
> > but throwable
> > }
> >
>
> This is a problem. f3 is _not_ @safe, it is @trusted. But unlike other
> violations, you won't find it by grepping for @trusted.
OK, I change the behavior in the case.
void fsafe() @safe pure {
asm {...} // f3 has @safe attribute, so this asm will report an error
asm @trusted {...} // OK
}
void ftrusted() @trusted {
asm {...}
// f3 has explicit @trusted attribute, so asm is inferred as @trusted
}
--
More information about the Digitalmars-d-bugs
mailing list