From 4f8c26d2c605f24cdeb1a4c7154662b2552640ef Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 8 Nov 2017 21:44:10 -0500 Subject: fix enum sizes too large closes #598 --- src/analyze.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/analyze.cpp') 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; -- cgit v1.2.3