| ... | @@ -3444,7 +3444,15 @@ fn validateStructInit( | ... | @@ -3444,7 +3444,15 @@ fn validateStructInit( |
| 3444 | } | 3444 | } |
| 3445 | if (air_tags[store_inst] != .store) continue; | 3445 | if (air_tags[store_inst] != .store) continue; |
| 3446 | const bin_op = air_datas[store_inst].bin_op; | 3446 | const bin_op = air_datas[store_inst].bin_op; |
| 3447 | if (bin_op.lhs != field_ptr_air_ref) continue; | 3447 | var lhs = bin_op.lhs; |
| | 3448 | { |
| | 3449 | const lhs_index = Air.refToIndex(lhs) orelse continue; |
| | 3450 | if (air_tags[lhs_index] == .bitcast) { |
| | 3451 | lhs = air_datas[lhs_index].ty_op.operand; |
| | 3452 | block_index -= 1; |
| | 3453 | } |
| | 3454 | } |
| | 3455 | if (lhs != field_ptr_air_ref) continue; |
| 3448 | if (block_index > 0 and | 3456 | if (block_index > 0 and |
| 3449 | field_ptr_air_inst == block.instructions.items[block_index - 1]) | 3457 | field_ptr_air_inst == block.instructions.items[block_index - 1]) |
| 3450 | { | 3458 | { |
| ... | @@ -3603,7 +3611,14 @@ fn zirValidateArrayInit( | ... | @@ -3603,7 +3611,14 @@ fn zirValidateArrayInit( |
| 3603 | switch (air_tags[next_air_inst]) { | 3611 | switch (air_tags[next_air_inst]) { |
| 3604 | .store => { | 3612 | .store => { |
| 3605 | const bin_op = air_datas[next_air_inst].bin_op; | 3613 | const bin_op = air_datas[next_air_inst].bin_op; |
| 3606 | if (bin_op.lhs != elem_ptr_air_ref) { | 3614 | var lhs = bin_op.lhs; |
| | 3615 | if (Air.refToIndex(lhs)) |lhs_index| { |
| | 3616 | if (air_tags[lhs_index] == .bitcast) { |
| | 3617 | lhs = air_datas[lhs_index].ty_op.operand; |
| | 3618 | block_index -= 1; |
| | 3619 | } |
| | 3620 | } |
| | 3621 | if (lhs != elem_ptr_air_ref) { |
| 3607 | array_is_comptime = false; | 3622 | array_is_comptime = false; |
| 3608 | continue; | 3623 | continue; |
| 3609 | } | 3624 | } |