Browse Source

fixed enums with >127 constructors (close #409)

Nicolas Cannasse 5 năm trước cách đây
mục cha
commit
5bdaef4cd7
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/code.c

+ 1 - 1
src/code.c

@@ -233,7 +233,7 @@ static void hl_read_type( hl_reader *r, hl_type *t ) {
 			t->tenum = hl_malloc(&r->code->alloc,sizeof(hl_type_enum));
 			t->tenum->name = hl_read_ustring(r);
 			t->tenum->global_value = (void**)(int_val)UINDEX();
-			t->tenum->nconstructs = READ();
+			t->tenum->nconstructs = UINDEX();
 			t->tenum->constructs = (hl_enum_construct*)hl_malloc(&r->code->alloc, sizeof(hl_enum_construct)*t->tenum->nconstructs);
 			for(i=0;i<t->tenum->nconstructs;i++) {
 				hl_enum_construct *c = t->tenum->constructs + i;