| ... | ... | @@ -19073,11 +19073,7 @@ static ZigType *ir_analyze_instruction_slice(IrAnalyze *ira, IrInstructionSlice |
| 19073 | 19073 | return ira->codegen->builtin_types.entry_invalid; |
| 19074 | 19074 | } |
| 19075 | 19075 | } else { |
| 19076 | | ZigType *slice_ptr_type = get_pointer_to_type_extra(ira->codegen, array_type->data.pointer.child_type, |
| 19077 | | array_type->data.pointer.is_const, array_type->data.pointer.is_volatile, |
| 19078 | | PtrLenUnknown, |
| 19079 | | array_type->data.pointer.explicit_alignment, 0, 0); |
| 19080 | | return_type = get_slice_type(ira->codegen, slice_ptr_type); |
| 19076 | return_type = get_slice_type(ira->codegen, array_type); |
| 19081 | 19077 | if (!end) { |
| 19082 | 19078 | ir_add_error(ira, &instruction->base, buf_sprintf("slice of pointer must include end value")); |
| 19083 | 19079 | return ira->codegen->builtin_types.entry_invalid; |
| ... | ... | @@ -19141,9 +19137,15 @@ static ZigType *ir_analyze_instruction_slice(IrAnalyze *ira, IrInstructionSlice |
| 19141 | 19137 | case ConstPtrSpecialDiscard: |
| 19142 | 19138 | zig_unreachable(); |
| 19143 | 19139 | case ConstPtrSpecialRef: |
| 19144 | | array_val = nullptr; |
| 19145 | | abs_offset = SIZE_MAX; |
| 19146 | | rel_end = 1; |
| 19140 | if (parent_ptr->data.x_ptr.data.ref.pointee->type->id == ZigTypeIdArray) { |
| 19141 | array_val = parent_ptr->data.x_ptr.data.ref.pointee; |
| 19142 | abs_offset = 0; |
| 19143 | rel_end = array_val->type->data.array.len; |
| 19144 | } else { |
| 19145 | array_val = nullptr; |
| 19146 | abs_offset = SIZE_MAX; |
| 19147 | rel_end = 1; |
| 19148 | } |
| 19147 | 19149 | break; |
| 19148 | 19150 | case ConstPtrSpecialBaseArray: |
| 19149 | 19151 | array_val = parent_ptr->data.x_ptr.data.base_array.array_val; |