aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-09-10 16:36:33 +0100
committergingerBill <bill@gingerbill.org>2020-09-10 16:36:33 +0100
commit6aa708a455502a016c91eb569e65954427e8bcf8 (patch)
treebf2a9f6ace26ca2c1e973aeb0787ce0950b0fd17 /src/check_decl.cpp
parent8f38b06c60a4bf028d931f7e2c9fc45b70cf7bd7 (diff)
Fix Odin bug with "none" procedure calling conventions in the runtime
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index c8070598b..639bf7d4f 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -1197,13 +1197,15 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty
ctx->curr_proc_sig = type;
ctx->curr_proc_calling_convention = type->Proc.calling_convention;
- switch (type->Proc.calling_convention) {
- case ProcCC_None:
- error(body, "Procedures with the calling convention \"none\" are not allowed a body");
- break;
- case ProcCC_PureNone:
- error(body, "Procedures with the calling convention \"pure_none\" are not allowed a body");
- break;
+ if (ctx->pkg->name != "runtime") {
+ switch (type->Proc.calling_convention) {
+ case ProcCC_None:
+ error(body, "Procedures with the calling convention \"none\" are not allowed a body");
+ break;
+ case ProcCC_PureNone:
+ error(body, "Procedures with the calling convention \"pure_none\" are not allowed a body");
+ break;
+ }
}
ast_node(bs, BlockStmt, body);