aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2022-03-14 11:09:52 +0000
committerGitHub <noreply@github.com>2022-03-14 11:09:52 +0000
commitfc0291d745ba4f7e8e2b58268ce04fdb8337d03d (patch)
treed7f0e6b1b62db60165759ab74ce53c49beca5b62 /src/check_type.cpp
parent77eaf8e1e4262884747c0bd1a6ebba1a10185207 (diff)
parenta7adb2fb6e092e1f37791b1da633b01ff3ca489c (diff)
Merge pull request #1526 from odin-lang/freestanding_amd64
Freestanding target for amd64
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 64fb67723..ecb2c26ea 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -2031,10 +2031,14 @@ bool check_procedure_type(CheckerContext *ctx, Type *type, Ast *proc_type_node,
if (param_count > 0) {
Entity *end = params->Tuple.variables[param_count-1];
if (end->flags&EntityFlag_CVarArg) {
- if (cc == ProcCC_StdCall || cc == ProcCC_CDecl) {
+ switch (cc) {
+ default:
type->Proc.c_vararg = true;
- } else {
+ break;
+ case ProcCC_Odin:
+ case ProcCC_Contextless:
error(end->token, "Calling convention does not support #c_vararg");
+ break;
}
}
}
@@ -2170,7 +2174,7 @@ void init_map_entry_type(Type *type) {
/*
struct {
- hash: runtime.Map_Hash,
+ hash: uintptr,
next: int,
key: Key,
value: Value,
@@ -3027,5 +3031,7 @@ Type *check_type_expr(CheckerContext *ctx, Ast *e, Type *named_type) {
}
set_base_type(named_type, type);
+ check_rtti_type_disallowed(e, type, "Use of a type, %s, which has been disallowed");
+
return type;
}