diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-03 16:46:10 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-03 16:46:10 +0900 |
| commit | 1b406b13b03055d2b2d08e8279a4a80c41ca7c20 (patch) | |
| tree | be9ed42948eda98add8eab24016ee015bf0389a7 /src/ast.c | |
| parent | 6e9ffa7cf08c83853e2fe84555d35eeaaf84e4f0 (diff) | |
| download | ducc-1b406b13b03055d2b2d08e8279a4a80c41ca7c20.tar.gz ducc-1b406b13b03055d2b2d08e8279a4a80c41ca7c20.tar.zst ducc-1b406b13b03055d2b2d08e8279a4a80c41ca7c20.zip | |
fix: div/mod/shift operations on unsigned integers
Diffstat (limited to 'src/ast.c')
| -rw-r--r-- | src/ast.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -126,6 +126,11 @@ bool type_is_unsized(Type* ty) { return ty->kind == TypeKind_void; } +bool type_is_unsigned(Type* ty) { + return ty->kind == TypeKind_uchar || ty->kind == TypeKind_ushort || ty->kind == TypeKind_uint || + ty->kind == TypeKind_ulong || ty->kind == TypeKind_ullong || ty->kind == TypeKind_bool; +} + int type_sizeof(Type* ty) { if (type_is_unsized(ty)) { fatal_error("type_sizeof: type size cannot be determined"); |
