| ... | @@ -3795,6 +3795,32 @@ fn zirValidateArrayInit( | ... | @@ -3795,6 +3795,32 @@ fn zirValidateArrayInit( |
| 3795 | } | 3795 | } |
| 3796 | continue; | 3796 | continue; |
| 3797 | }, | 3797 | }, |
| | 3798 | .bitcast => { |
| | 3799 | // %a = bitcast(*arr_ty, %array_base) |
| | 3800 | // %b = ptr_elem_ptr(%a, %index) |
| | 3801 | // %c = bitcast(*elem_ty, %b) |
| | 3802 | // %d = store(%c, %val) |
| | 3803 | if (air_datas[next_air_inst].ty_op.operand != elem_ptr_air_ref) { |
| | 3804 | array_is_comptime = false; |
| | 3805 | continue; |
| | 3806 | } |
| | 3807 | const store_inst = block.instructions.items[block_index + 2]; |
| | 3808 | if (air_tags[store_inst] != .store) { |
| | 3809 | array_is_comptime = false; |
| | 3810 | continue; |
| | 3811 | } |
| | 3812 | const bin_op = air_datas[store_inst].bin_op; |
| | 3813 | if (bin_op.lhs != Air.indexToRef(next_air_inst)) { |
| | 3814 | array_is_comptime = false; |
| | 3815 | continue; |
| | 3816 | } |
| | 3817 | if (try sema.resolveMaybeUndefValAllowVariables(block, elem_src, bin_op.rhs)) |val| { |
| | 3818 | element_vals[i] = val; |
| | 3819 | } else { |
| | 3820 | array_is_comptime = false; |
| | 3821 | } |
| | 3822 | continue; |
| | 3823 | }, |
| 3798 | else => { | 3824 | else => { |
| 3799 | array_is_comptime = false; | 3825 | array_is_comptime = false; |
| 3800 | continue; | 3826 | continue; |