diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-01-10 00:18:17 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-01-10 00:23:37 +0900 |
| commit | 97980c1f3896a630e146fb12d475edbb6c52cbf7 (patch) | |
| tree | 7fc51e5525b9feeb660bc46ea622189bbdc2ef55 /src/ast.c | |
| parent | 2f386c19d96ab774467e0e97e8c032441e08ced8 (diff) | |
| download | ducc-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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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(); } |
