diff --git a/src/compiler/sema_stmts.c b/src/compiler/sema_stmts.c index 0498afc9c..4e1d47f4d 100644 --- a/src/compiler/sema_stmts.c +++ b/src/compiler/sema_stmts.c @@ -3108,7 +3108,7 @@ bool sema_analyse_function_body(SemaContext *context, Decl *func) while (current) { Ast *stmt = ast_next(¤t); - if (stmt->ast_kind != AST_ASM_STMT) + if (stmt->ast_kind != AST_ASM_BLOCK_STMT) { SEMA_ERROR(stmt, "Only asm statements are allowed inside of a naked function."); return false; diff --git a/src/version.h b/src/version.h index c0154fcc2..61142e672 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define COMPILER_VERSION "0.4.680" \ No newline at end of file +#define COMPILER_VERSION "0.4.681" \ No newline at end of file diff --git a/test/test_suite/asm/naked.c3t b/test/test_suite/asm/naked.c3t new file mode 100644 index 000000000..9bd8b6e55 --- /dev/null +++ b/test/test_suite/asm/naked.c3t @@ -0,0 +1,11 @@ +// #target: macos-x64 +module testing; +import std::io; + +fn void test() @naked @export("hello") +{ + asm("nop"); +} +fn void main() +{ +} \ No newline at end of file