| ... | @@ -26283,17 +26283,7 @@ fn fieldPtr( | ... | @@ -26283,17 +26283,7 @@ fn fieldPtr( |
| 26283 | const attr_ptr_ty = if (is_pointer_to) object_ty else object_ptr_ty; | 26283 | const attr_ptr_ty = if (is_pointer_to) object_ty else object_ptr_ty; |
| 26284 | | 26284 | |
| 26285 | if (field_name.eqlSlice("ptr", ip)) { | 26285 | if (field_name.eqlSlice("ptr", ip)) { |
| 26286 | const slice_ptr_ty = inner_ty.slicePtrFieldType(zcu); | 26286 | const result_ty = try attr_ptr_ty.fieldPtrType(Value.slice_ptr_index, pt); |
| 26287 | | | |
| 26288 | const result_ty = try pt.ptrType(.{ | | |
| 26289 | .child = slice_ptr_ty.toIntern(), | | |
| 26290 | .flags = .{ | | |
| 26291 | .is_const = !attr_ptr_ty.ptrIsMutable(zcu), | | |
| 26292 | .is_volatile = attr_ptr_ty.isVolatilePtr(zcu), | | |
| 26293 | .address_space = attr_ptr_ty.ptrAddressSpace(zcu), | | |
| 26294 | }, | | |
| 26295 | }); | | |
| 26296 | | | |
| 26297 | if (try sema.resolveDefinedValue(block, object_ptr_src, inner_ptr)) |val| { | 26287 | if (try sema.resolveDefinedValue(block, object_ptr_src, inner_ptr)) |val| { |
| 26298 | return Air.internedToRef((try val.ptrField(Value.slice_ptr_index, pt)).toIntern()); | 26288 | return Air.internedToRef((try val.ptrField(Value.slice_ptr_index, pt)).toIntern()); |
| 26299 | } | 26289 | } |
| ... | @@ -26303,15 +26293,7 @@ fn fieldPtr( | ... | @@ -26303,15 +26293,7 @@ fn fieldPtr( |
| 26303 | try sema.checkKnownAllocPtr(block, inner_ptr, field_ptr); | 26293 | try sema.checkKnownAllocPtr(block, inner_ptr, field_ptr); |
| 26304 | return field_ptr; | 26294 | return field_ptr; |
| 26305 | } else if (field_name.eqlSlice("len", ip)) { | 26295 | } else if (field_name.eqlSlice("len", ip)) { |
| 26306 | const result_ty = try pt.ptrType(.{ | 26296 | const result_ty = try attr_ptr_ty.fieldPtrType(Value.slice_len_index, pt); |
| 26307 | .child = .usize_type, | | |
| 26308 | .flags = .{ | | |
| 26309 | .is_const = !attr_ptr_ty.ptrIsMutable(zcu), | | |
| 26310 | .is_volatile = attr_ptr_ty.isVolatilePtr(zcu), | | |
| 26311 | .address_space = attr_ptr_ty.ptrAddressSpace(zcu), | | |
| 26312 | }, | | |
| 26313 | }); | | |
| 26314 | | | |
| 26315 | if (try sema.resolveDefinedValue(block, object_ptr_src, inner_ptr)) |val| { | 26297 | if (try sema.resolveDefinedValue(block, object_ptr_src, inner_ptr)) |val| { |
| 26316 | return Air.internedToRef((try val.ptrField(Value.slice_len_index, pt)).toIntern()); | 26298 | return Air.internedToRef((try val.ptrField(Value.slice_len_index, pt)).toIntern()); |
| 26317 | } | 26299 | } |