@@ -27196,6 +27196,37 @@ fn fieldPtr(
27196
27196
if (ip.stringEqlSlice(field_name, "len")) {
27197
27197
const int_val = try mod.intValue(Type.usize, inner_ty.arrayLen(mod));
27198
27198
return anonDeclRef(sema, int_val.toIntern());
27199
+ } else if (ip.stringEqlSlice(field_name, "ptr") and is_pointer_to) {
27200
+ const ptr_info = object_ty.ptrInfo(mod);
27201
+ const new_ptr_ty = try sema.ptrType(.{
27202
+ .child = Type.fromInterned(ptr_info.child).childType(mod).toIntern(),
27203
+ .sentinel = if (object_ty.sentinel(mod)) |s| s.toIntern() else .none,
27204
+ .flags = .{
27205
+ .size = .Many,
27206
+ .alignment = ptr_info.flags.alignment,
27207
+ .is_const = ptr_info.flags.is_const,
27208
+ .is_volatile = ptr_info.flags.is_volatile,
27209
+ .is_allowzero = ptr_info.flags.is_allowzero,
27210
+ .address_space = ptr_info.flags.address_space,
27211
+ .vector_index = ptr_info.flags.vector_index,
27212
+ },
27213
+ .packed_offset = ptr_info.packed_offset,
27214
+ });
27215
+ const ptr_ptr_info = object_ptr_ty.ptrInfo(mod);
27216
+ const result_ty = try sema.ptrType(.{
27217
+ .child = new_ptr_ty.toIntern(),
27218
+ .sentinel = if (object_ptr_ty.sentinel(mod)) |s| s.toIntern() else .none,
27219
+ .flags = .{
27220
+ .alignment = ptr_ptr_info.flags.alignment,
27221
+ .is_const = ptr_ptr_info.flags.is_const,
27222
+ .is_volatile = ptr_ptr_info.flags.is_volatile,
27223
+ .is_allowzero = ptr_ptr_info.flags.is_allowzero,
27224
+ .address_space = ptr_ptr_info.flags.address_space,
27225
+ .vector_index = ptr_ptr_info.flags.vector_index,
27226
+ },
27227
+ .packed_offset = ptr_ptr_info.packed_offset,
27228
+ });
27229
+ return sema.bitCast(block, result_ty, object_ptr, src, null);
27199
27230
} else {
27200
27231
return sema.fail(
27201
27232
block,
0 commit comments