Fix Odin bug with "none" procedure calling conventions in the runtime
This commit is contained in:
1 parent
8f38b06c60
commit
6aa708a455
2 files changed
+15
-13
No files matched your search
+9
-7
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user