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