aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ast.c
diff options
context:
space:
mode:
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();
}