| ... | ... | @@ -10697,6 +10697,19 @@ static IrInstruction *ir_analyze_cast(IrAnalyze *ira, IrInstruction *source_inst |
| 10697 | 10697 | return ira->codegen->invalid_instruction; |
| 10698 | 10698 | |
| 10699 | 10699 | return cast2; |
| 10700 | } else if ( |
| 10701 | wanted_child_type->id == TypeTableEntryIdPointer && |
| 10702 | wanted_child_type->data.pointer.ptr_len == PtrLenUnknown && |
| 10703 | actual_type->id == TypeTableEntryIdPointer && |
| 10704 | actual_type->data.pointer.ptr_len == PtrLenSingle && |
| 10705 | actual_type->data.pointer.child_type->id == TypeTableEntryIdArray && |
| 10706 | actual_type->data.pointer.alignment >= wanted_child_type->data.pointer.alignment && |
| 10707 | types_match_const_cast_only(ira, wanted_child_type->data.pointer.child_type, |
| 10708 | actual_type->data.pointer.child_type->data.array.child_type, source_node, |
| 10709 | !wanted_child_type->data.pointer.is_const).id == ConstCastResultIdOk) |
| 10710 | { |
| 10711 | IrInstruction *cast1 = ir_resolve_ptr_of_array_to_slice(ira, source_instr, value, wanted_child_type); |
| 10712 | return ir_analyze_maybe_wrap(ira, source_instr, cast1, wanted_type); |
| 10700 | 10713 | } |
| 10701 | 10714 | } |
| 10702 | 10715 | |