[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH gnumach] Fix assertion for i686 since mach_port_name_t and mach_p
From: |
Flavio Cruz |
Subject: |
[PATCH gnumach] Fix assertion for i686 since mach_port_name_t and mach_port_t have the same size |
Date: |
Mon, 6 Nov 2023 18:01:44 -0500 |
---
ipc/ipc_kmsg.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ipc/ipc_kmsg.c b/ipc/ipc_kmsg.c
index 1b98445d..fb8de249 100644
--- a/ipc/ipc_kmsg.c
+++ b/ipc/ipc_kmsg.c
@@ -2385,7 +2385,8 @@ ipc_kmsg_copyout_body(
/* first allocate memory in the map */
uint64_t allocated = length;
- assert(sizeof(mach_port_name_t) <
sizeof(mach_port_t));
+ _Static_assert(sizeof(mach_port_name_t) <=
sizeof(mach_port_t),
+ "Size of mach_port_t should be
equal or larger than mach_port_name_t.");
allocated -= (sizeof(mach_port_t) -
sizeof(mach_port_name_t)) * number;
kr = vm_allocate(map, &addr, allocated, TRUE);
--
2.39.2
- [PATCH gnumach] Fix assertion for i686 since mach_port_name_t and mach_port_t have the same size,
Flavio Cruz <=