Skip to content

Commit

Permalink
issue #85
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdruppe committed Nov 15, 2024
1 parent 7c632a9 commit 5bf2a3c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/src/dmd/statementsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -3812,6 +3812,10 @@ version (IN_LLVM)
}

assert(sc.func);

if(sc && sc.flags & SCOPE.Cfile)
goto skip_checks; // just assume import c functions don't care about attributes in asm

if (!(cas.stc & STC.pure_) && sc.func.setImpure(cas.loc, "`asm` statement is assumed to be impure - mark it with `pure` if it is not"))
error(cas.loc, "`asm` statement is assumed to be impure - mark it with `pure` if it is not");
if (!(cas.stc & STC.nogc) && sc.func.setGC(cas.loc, "`asm` statement in %s `%s` is assumed to use the GC - mark it with `@nogc` if it does not"))
Expand All @@ -3826,6 +3830,8 @@ version (IN_LLVM)
sc.setUnsafe(false, cas.loc, "`asm` statement is assumed to be `@system` - mark it with `@trusted` if it is not", false);
}

skip_checks:

sc.pop();
result = cas;
}
Expand Down

0 comments on commit 5bf2a3c

Please sign in to comment.