diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-11-08 21:44:10 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-11-08 21:44:10 -0500 |
| commit | 4f8c26d2c605f24cdeb1a4c7154662b2552640ef (patch) | |
| tree | 926037a3a45f58d191a589d4ed137f4c1bb81bdf /src/analyze.cpp | |
| parent | 53b18c8542d6d40c3aa41e9d97290a4ca46eaa15 (diff) | |
| download | zig-4f8c26d2c605f24cdeb1a4c7154662b2552640ef.tar.gz zig-4f8c26d2c605f24cdeb1a4c7154662b2552640ef.zip | |
fix enum sizes too large
closes #598
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 0dc221408d..7d46ebc908 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -1389,7 +1389,7 @@ static void resolve_enum_type(CodeGen *g, TypeTableEntry *enum_type) { return; } - TypeTableEntry *tag_int_type = get_smallest_unsigned_int_type(g, field_count); + TypeTableEntry *tag_int_type = get_smallest_unsigned_int_type(g, field_count - 1); TypeTableEntry *tag_type_entry = create_enum_tag_type(g, enum_type, tag_int_type); enum_type->data.enumeration.tag_type = tag_type_entry; |
