File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -29922,8 +29922,13 @@ fn beginComptimePtrMutation(
2992229922 // We might have a pointer to multiple elements of the array (e.g. a pointer
2992329923 // to a sub-array). In this case, we just have to reinterpret the relevant
2992429924 // bytes of the whole array rather than any single element.
29925- const elem_abi_size_u64 = try sema.typeAbiSize(base_elem_ty);
29926- if (elem_abi_size_u64 < try sema.typeAbiSize(ptr_elem_ty)) {
29925+ reinterp_multi_elem: {
29926+ if (try sema.typeRequiresComptime(base_elem_ty)) break :reinterp_multi_elem;
29927+ if (try sema.typeRequiresComptime(ptr_elem_ty)) break :reinterp_multi_elem;
29928+
29929+ const elem_abi_size_u64 = try sema.typeAbiSize(base_elem_ty);
29930+ if (elem_abi_size_u64 >= try sema.typeAbiSize(ptr_elem_ty)) break :reinterp_multi_elem;
29931+
2992729932 const elem_abi_size = try sema.usizeCast(block, src, elem_abi_size_u64);
2992829933 const elem_idx = try sema.usizeCast(block, src, elem_ptr.index);
2992929934 return .{
You can’t perform that action at this time.
0 commit comments