bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH gnumach] Fix assertion for i686 since mach_port_name_t and ma


From: Samuel Thibault
Subject: Re: [PATCH gnumach] Fix assertion for i686 since mach_port_name_t and mach_port_t have the same size
Date: Tue, 7 Nov 2023 00:05:36 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Applied, thanks!

Flavio Cruz, le lun. 06 nov. 2023 18:01:44 -0500, a ecrit:
> ---
>  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
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]