mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
Address Spaces: Disallow coercing pointers to different address spaces
This commit is contained in:
parent
0e6dc64a6f
commit
e182c17187
@ -9132,6 +9132,7 @@ fn coerce(
|
||||
const dest_is_mut = !dest_type.isConstPtr();
|
||||
if (inst_ty.isConstPtr() and dest_is_mut) break :src_array_ptr;
|
||||
if (inst_ty.isVolatilePtr() and !dest_type.isVolatilePtr()) break :src_array_ptr;
|
||||
if (inst_ty.ptrAddressSpace() != dest_type.ptrAddressSpace()) break :src_array_ptr;
|
||||
|
||||
const dst_elem_type = dest_type.elemType();
|
||||
switch (coerceInMemoryAllowed(dst_elem_type, array_elem_type, dest_is_mut)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user