commit e77fcf17301ad5a68e84cb598984a526cc356621 (tree)
parent 8672f2696f20e8989d42f69adbe09edfe5cd9332
Author: Robin Voetter <robin@voetter.nl>
Date: Fri, 27 Aug 2021 02:48:29 +0200
Address Spaces: Implement right address space for slicing
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/Sema.zig b/src/Sema.zig
@@ -9767,9 +9767,7 @@ fn analyzeSlice(
return_elem_type,
if (end_opt == .none) slice_sentinel else null,
0, // TODO alignment
- // TODO(Snektron) address space, should be inferred from the pointer type.
- // TODO(Snektron) address space for slicing a local, should compute address space from context and architecture.
- .generic,
+ if (ptr_child.zigTypeTag() == .Pointer) ptr_child.ptrAddressSpace() else .generic,
0,
0,
!ptr_child.isConstPtr(),