From ad26c25137086b6e001ce1a7f82b4656724200da Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Thu, 14 Dec 2023 01:02:28 -0500 Subject: Update code to handle the new ABI for sending inlined port rights. For i686, this change is no op but for x86_64 it forces all inlined port rights to be 8 bytes long. --- mach/msg-destroy.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'mach') diff --git a/mach/msg-destroy.c b/mach/msg-destroy.c index 19137ba..8640c96 100644 --- a/mach/msg-destroy.c +++ b/mach/msg-destroy.c @@ -108,11 +108,17 @@ __mach_msg_destroy (mach_msg_header_t *msg) addr = is_inline ? saddr : * (vm_offset_t *) saddr; if (MACH_MSG_TYPE_PORT_ANY(name)) { - mach_port_t *ports = (mach_port_t *) addr; mach_msg_type_number_t i; - for (i = 0; i < number; i++) - mach_msg_destroy_port(*ports++, name); + if (is_inline) { + mach_port_name_inlined_t *inlined_ports = (mach_port_name_inlined_t *)addr; + for (i = 0; i < number; i++) + mach_msg_destroy_port(inlined_ports[i].name, name); + } else { + mach_port_t *ports = (mach_port_t *) addr; + for (i = 0; i < number; i++) + mach_msg_destroy_port(ports[i], name); + } } if (is_inline) { -- cgit v1.1