aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ast.c
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-01-10 00:18:17 +0900
committernsfisis <nsfisis@gmail.com>2026-01-10 00:23:37 +0900
commit97980c1f3896a630e146fb12d475edbb6c52cbf7 (patch)
tree7fc51e5525b9feeb660bc46ea622189bbdc2ef55 /src/ast.c
parent2f386c19d96ab774467e0e97e8c032441e08ced8 (diff)
downloadducc-97980c1f3896a630e146fb12d475edbb6c52cbf7.tar.gz
ducc-97980c1f3896a630e146fb12d475edbb6c52cbf7.tar.zst
ducc-97980c1f3896a630e146fb12d475edbb6c52cbf7.zip
feat: support passing arguments larger than 8 bytes
Diffstat (limited to 'src/ast.c')
-rw-r--r--src/ast.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ast.c b/src/ast.c
index 388e211..59a2087 100644
--- a/src/ast.c
+++ b/src/ast.c
@@ -113,7 +113,7 @@ Type* type_new_func(Type* result, AstNode* params) {
}
bool type_is_unsized(Type* ty) {
- return ty->kind == TypeKind_void || ty->kind == TypeKind_func;
+ return ty->kind == TypeKind_void;
}
int type_sizeof(Type* ty) {
@@ -141,6 +141,8 @@ int type_sizeof(Type* ty) {
return 8;
else if (ty->kind == TypeKind_array)
return type_sizeof(ty->base) * ty->array_size;
+ else if (ty->kind == TypeKind_func)
+ return 8;
else
unreachable();
}
@@ -170,6 +172,8 @@ int type_alignof(Type* ty) {
return 8;
else if (ty->kind == TypeKind_array)
return type_alignof(ty->base);
+ else if (ty->kind == TypeKind_func)
+ return 8;
else
unreachable();
}