diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-06-26 14:54:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-26 14:54:20 +0200 |
| commit | 88c208d1fbbaa250adb07637b3002d4df38af962 (patch) | |
| tree | c892c496618cbc970cbb0c70dae9ee86ca94b02c /src/types.cpp | |
| parent | 62e797b9d15d32b7db906e99e98f0943bf2aa6e3 (diff) | |
| parent | 1fbc5641c0212dc30ea514f69a640a6d1fb5bd11 (diff) | |
Merge pull request #5408 from slowhei/master
Fix bug where compiler treats uint enums as ints
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp index 19df3de9d..74da7f6aa 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -1248,6 +1248,9 @@ gb_internal bool is_type_unsigned(Type *t) { if (t->kind == Type_Basic) { return (t->Basic.flags & BasicFlag_Unsigned) != 0; } + if (t->kind == Type_Enum) { + return (t->Enum.base_type->Basic.flags & BasicFlag_Unsigned) != 0; + } return false; } gb_internal bool is_type_integer_128bit(Type *t) { |