| ... | @@ -4076,6 +4076,9 @@ static AstNode *trans_ap_value(Context *c, APValue *ap_value, QualType qt, const | ... | @@ -4076,6 +4076,9 @@ static AstNode *trans_ap_value(Context *c, APValue *ap_value, QualType qt, const |
| 4076 | unsigned leftover_count = all_count - init_count; | 4076 | unsigned leftover_count = all_count - init_count; |
| 4077 | AstNode *init_node = trans_create_node(c, NodeTypeContainerInitExpr); | 4077 | AstNode *init_node = trans_create_node(c, NodeTypeContainerInitExpr); |
| 4078 | AstNode *arr_type_node = trans_qual_type(c, qt, source_loc); | 4078 | AstNode *arr_type_node = trans_qual_type(c, qt, source_loc); |
| | 4079 | if (leftover_count != 0) { // We can't use the size of the final array for a partial initializer. |
| | 4080 | bigint_init_unsigned(arr_type_node->data.array_type.size->data.int_literal.bigint, init_count); |
| | 4081 | } |
| 4079 | init_node->data.container_init_expr.type = arr_type_node; | 4082 | init_node->data.container_init_expr.type = arr_type_node; |
| 4080 | init_node->data.container_init_expr.kind = ContainerInitKindArray; | 4083 | init_node->data.container_init_expr.kind = ContainerInitKindArray; |
| 4081 | | 4084 | |
| ... | @@ -4097,10 +4100,14 @@ static AstNode *trans_ap_value(Context *c, APValue *ap_value, QualType qt, const | ... | @@ -4097,10 +4100,14 @@ static AstNode *trans_ap_value(Context *c, APValue *ap_value, QualType qt, const |
| 4097 | if (filler_node == nullptr) | 4100 | if (filler_node == nullptr) |
| 4098 | return nullptr; | 4101 | return nullptr; |
| 4099 | | 4102 | |
| | 4103 | AstNode* filler_arr_type = trans_create_node(c, NodeTypeArrayType); |
| | 4104 | *filler_arr_type = *arr_type_node; |
| | 4105 | filler_arr_type->data.array_type.size = trans_create_node_unsigned(c, 1); |
| | 4106 | |
| 4100 | AstNode *filler_arr_1 = trans_create_node(c, NodeTypeContainerInitExpr); | 4107 | AstNode *filler_arr_1 = trans_create_node(c, NodeTypeContainerInitExpr); |
| 4101 | init_node->data.container_init_expr.type = arr_type_node; | 4108 | filler_arr_1->data.container_init_expr.type = filler_arr_type; |
| 4102 | init_node->data.container_init_expr.kind = ContainerInitKindArray; | 4109 | filler_arr_1->data.container_init_expr.kind = ContainerInitKindArray; |
| 4103 | init_node->data.container_init_expr.entries.append(filler_node); | 4110 | filler_arr_1->data.container_init_expr.entries.append(filler_node); |
| 4104 | | 4111 | |
| 4105 | AstNode *rhs_node; | 4112 | AstNode *rhs_node; |
| 4106 | if (leftover_count == 1) { | 4113 | if (leftover_count == 1) { |