| ... | ... | @@ -1589,6 +1589,9 @@ static void resolve_struct_type(CodeGen *g, ImportTableEntry *import, TypeTableE |
| 1589 | 1589 | |
| 1590 | 1590 | TypeTableEntry *field_type = type_struct_field->type_entry; |
| 1591 | 1591 | |
| 1592 | assert(field_type->type_ref); |
| 1593 | assert(struct_type->type_ref); |
| 1594 | assert(struct_type->data.structure.complete); |
| 1592 | 1595 | uint64_t debug_size_in_bits = 8*LLVMStoreSizeOfType(g->target_data_ref, field_type->type_ref); |
| 1593 | 1596 | uint64_t debug_align_in_bits = 8*LLVMABISizeOfType(g->target_data_ref, field_type->type_ref); |
| 1594 | 1597 | uint64_t debug_offset_in_bits = 8*LLVMOffsetOfElement(g->target_data_ref, struct_type->type_ref, |
| ... | ... | @@ -4065,7 +4068,8 @@ static TypeTableEntry *analyze_array_type(CodeGen *g, ImportTableEntry *import, |
| 4065 | 4068 | { |
| 4066 | 4069 | AstNode *size_node = node->data.array_type.size; |
| 4067 | 4070 | |
| 4068 | | TypeTableEntry *child_type = analyze_type_expr(g, import, context, node->data.array_type.child_type); |
| 4071 | TypeTableEntry *child_type = analyze_type_expr_pointer_only(g, import, context, |
| 4072 | node->data.array_type.child_type, true); |
| 4069 | 4073 | |
| 4070 | 4074 | if (child_type->id == TypeTableEntryIdUnreachable) { |
| 4071 | 4075 | add_node_error(g, node, buf_create_from_str("array of unreachable not allowed")); |
| ... | ... | @@ -4075,6 +4079,7 @@ static TypeTableEntry *analyze_array_type(CodeGen *g, ImportTableEntry *import, |
| 4075 | 4079 | } |
| 4076 | 4080 | |
| 4077 | 4081 | if (size_node) { |
| 4082 | child_type = analyze_type_expr(g, import, context, node->data.array_type.child_type); |
| 4078 | 4083 | TypeTableEntry *size_type = analyze_expression(g, import, context, |
| 4079 | 4084 | g->builtin_types.entry_usize, size_node); |
| 4080 | 4085 | if (size_type->id == TypeTableEntryIdInvalid) { |
| ... | ... | @@ -4101,8 +4106,8 @@ static TypeTableEntry *analyze_array_type(CodeGen *g, ImportTableEntry *import, |
| 4101 | 4106 | return g->builtin_types.entry_invalid; |
| 4102 | 4107 | } |
| 4103 | 4108 | } else { |
| 4104 | | return resolve_expr_const_val_as_type(g, node, |
| 4105 | | get_slice_type(g, child_type, node->data.array_type.is_const), false); |
| 4109 | TypeTableEntry *slice_type = get_slice_type(g, child_type, node->data.array_type.is_const); |
| 4110 | return resolve_expr_const_val_as_type(g, node, slice_type, false); |
| 4106 | 4111 | } |
| 4107 | 4112 | } |
| 4108 | 4113 | |