| ... | @@ -4071,6 +4071,19 @@ fn zirValidateArrayInit( | ... | @@ -4071,6 +4071,19 @@ fn zirValidateArrayInit( |
| 4071 | | 4071 | |
| 4072 | // Determine whether the value stored to this pointer is comptime-known. | 4072 | // Determine whether the value stored to this pointer is comptime-known. |
| 4073 | | 4073 | |
| | 4074 | if (array_ty.isTuple()) { |
| | 4075 | if (array_ty.structFieldValueComptime(i)) |opv| { |
| | 4076 | element_vals[i] = opv; |
| | 4077 | continue; |
| | 4078 | } |
| | 4079 | } else { |
| | 4080 | // Array has one possible value, so value is always comptime-known |
| | 4081 | if (opt_opv) |opv| { |
| | 4082 | element_vals[i] = opv; |
| | 4083 | continue; |
| | 4084 | } |
| | 4085 | } |
| | 4086 | |
| 4074 | const elem_ptr_air_ref = sema.inst_map.get(elem_ptr).?; | 4087 | const elem_ptr_air_ref = sema.inst_map.get(elem_ptr).?; |
| 4075 | const elem_ptr_air_inst = Air.refToIndex(elem_ptr_air_ref).?; | 4088 | const elem_ptr_air_inst = Air.refToIndex(elem_ptr_air_ref).?; |
| 4076 | // Find the block index of the elem_ptr so that we can look at the next | 4089 | // Find the block index of the elem_ptr so that we can look at the next |
| ... | @@ -4087,19 +4100,6 @@ fn zirValidateArrayInit( | ... | @@ -4087,19 +4100,6 @@ fn zirValidateArrayInit( |
| 4087 | } | 4100 | } |
| 4088 | first_block_index = @minimum(first_block_index, block_index); | 4101 | first_block_index = @minimum(first_block_index, block_index); |
| 4089 | | 4102 | |
| 4090 | if (array_ty.isTuple()) { | | |
| 4091 | if (array_ty.structFieldValueComptime(i)) |opv| { | | |
| 4092 | element_vals[i] = opv; | | |
| 4093 | continue; | | |
| 4094 | } | | |
| 4095 | } else { | | |
| 4096 | // Array has one possible value, so value is always comptime-known | | |
| 4097 | if (opt_opv) |opv| { | | |
| 4098 | element_vals[i] = opv; | | |
| 4099 | continue; | | |
| 4100 | } | | |
| 4101 | } | | |
| 4102 | | | |
| 4103 | // If the next instructon is a store with a comptime operand, this element | 4103 | // If the next instructon is a store with a comptime operand, this element |
| 4104 | // is comptime. | 4104 | // is comptime. |
| 4105 | const next_air_inst = block.instructions.items[block_index + 1]; | 4105 | const next_air_inst = block.instructions.items[block_index + 1]; |