authorgravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2021-08-26 03:31:03+02:00
committergravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2021-09-20 02:29:03+02:00
loge182c17187c12cfb448cf47a04a156caaf9e3fc9
tree80f6924e220fa7da8c28b48dc07266e5048b3ac3
parent0e6dc64a6fa173ae92197f692cf907fdc8bbf811

Address Spaces: Disallow coercing pointers to different address spaces


1 files changed, 1 insertions(+), 0 deletions(-)

src/Sema.zig+1
...@@ -9132,6 +9132,7 @@ fn coerce(...@@ -9132,6 +9132,7 @@ fn coerce(
9132 const dest_is_mut = !dest_type.isConstPtr();9132 const dest_is_mut = !dest_type.isConstPtr();
9133 if (inst_ty.isConstPtr() and dest_is_mut) break :src_array_ptr;9133 if (inst_ty.isConstPtr() and dest_is_mut) break :src_array_ptr;
9134 if (inst_ty.isVolatilePtr() and !dest_type.isVolatilePtr()) break :src_array_ptr;9134 if (inst_ty.isVolatilePtr() and !dest_type.isVolatilePtr()) break :src_array_ptr;
9135 if (inst_ty.ptrAddressSpace() != dest_type.ptrAddressSpace()) break :src_array_ptr;
91359136
9136 const dst_elem_type = dest_type.elemType();9137 const dst_elem_type = dest_type.elemType();
9137 switch (coerceInMemoryAllowed(dst_elem_type, array_elem_type, dest_is_mut)) {9138 switch (coerceInMemoryAllowed(dst_elem_type, array_elem_type, dest_is_mut)) {