| ... | ... | @@ -803,13 +803,7 @@ ZigType *get_array_type(CodeGen *g, ZigType *child_type, uint64_t array_size, Zi |
| 803 | 803 | } |
| 804 | 804 | buf_appendf(&entry->name, "]%s", buf_ptr(&child_type->name)); |
| 805 | 805 | |
| 806 | | size_t full_array_size; |
| 807 | | if (array_size == 0) { |
| 808 | | full_array_size = 0; |
| 809 | | } else { |
| 810 | | full_array_size = array_size + ((sentinel != nullptr) ? 1 : 0); |
| 811 | | } |
| 812 | | |
| 806 | size_t full_array_size = array_size + ((sentinel != nullptr) ? 1 : 0); |
| 813 | 807 | entry->size_in_bits = child_type->size_in_bits * full_array_size; |
| 814 | 808 | entry->abi_align = child_type->abi_align; |
| 815 | 809 | entry->abi_size = child_type->abi_size * full_array_size; |
| ... | ... | @@ -1197,7 +1191,8 @@ Error type_val_resolve_zero_bits(CodeGen *g, ZigValue *type_val, ZigType *parent |
| 1197 | 1191 | LazyValueArrayType *lazy_array_type = |
| 1198 | 1192 | reinterpret_cast<LazyValueArrayType *>(type_val->data.x_lazy); |
| 1199 | 1193 | |
| 1200 | | if (lazy_array_type->length < 1) { |
| 1194 | // The sentinel counts as an extra element |
| 1195 | if (lazy_array_type->length == 0 && lazy_array_type->sentinel == nullptr) { |
| 1201 | 1196 | *is_zero_bits = true; |
| 1202 | 1197 | return ErrorNone; |
| 1203 | 1198 | } |
| ... | ... | @@ -1452,7 +1447,8 @@ static OnePossibleValue type_val_resolve_has_one_possible_value(CodeGen *g, ZigV |
| 1452 | 1447 | case LazyValueIdArrayType: { |
| 1453 | 1448 | LazyValueArrayType *lazy_array_type = |
| 1454 | 1449 | reinterpret_cast<LazyValueArrayType *>(type_val->data.x_lazy); |
| 1455 | | if (lazy_array_type->length < 1) |
| 1450 | // The sentinel counts as an extra element |
| 1451 | if (lazy_array_type->length == 0 && lazy_array_type->sentinel == nullptr) |
| 1456 | 1452 | return OnePossibleValueYes; |
| 1457 | 1453 | return type_val_resolve_has_one_possible_value(g, lazy_array_type->elem_type->value); |
| 1458 | 1454 | } |
| ... | ... | @@ -5739,7 +5735,8 @@ OnePossibleValue type_has_one_possible_value(CodeGen *g, ZigType *type_entry) { |
| 5739 | 5735 | case ZigTypeIdUnreachable: |
| 5740 | 5736 | return OnePossibleValueYes; |
| 5741 | 5737 | case ZigTypeIdArray: |
| 5742 | | if (type_entry->data.array.len == 0) |
| 5738 | // The sentinel counts as an extra element |
| 5739 | if (type_entry->data.array.len == 0 && type_entry->data.array.sentinel == nullptr) |
| 5743 | 5740 | return OnePossibleValueYes; |
| 5744 | 5741 | return type_has_one_possible_value(g, type_entry->data.array.child_type); |
| 5745 | 5742 | case ZigTypeIdStruct: |