From 5e0706dfc69b81d7ec33dac7f1aecae51a2edd7a Mon Sep 17 00:00:00 2001
From: Flavio Cruz <flaviocruz@gmail.com>
Date: Mon, 6 Nov 2023 18:01:44 -0500
Subject: Fix assertion for i686 since mach_port_name_t and mach_port_t have
 the same size

Message-ID: <ZUlwWGgc2kXNH5dN@jupiter.tail36e24.ts.net>
---
 ipc/ipc_kmsg.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'ipc')

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);
-- 
cgit v1.2.3