From 2fbfa0358b3bb920ddd1c2747d4887b35b9ac161 Mon Sep 17 00:00:00 2001 From: Jessica Clarke Date: Thu, 13 Jan 2022 05:20:14 +0000 Subject: [PATCH] unix: fix STATIC_ASSERT to check what it means to check (#3417) Currently it's checking pointers to the uv_buf_t fields match the size of the iovec fields. This is true on traditional architectures where pointers are just machine word-sized integers, but not on CHERI, and thus Arm's Morello prototype, where pointers contain additional metadata (including bounds and permissions). Drop the & to fix this. --- src/unix/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/unix/core.c b/src/unix/core.c index 71e9c525..3dd3fd90 100644 --- a/src/unix/core.c +++ b/src/unix/core.c @@ -96,9 +96,9 @@ static int uv__run_pending(uv_loop_t* loop); /* Verify that uv_buf_t is ABI-compatible with struct iovec. */ STATIC_ASSERT(sizeof(uv_buf_t) == sizeof(struct iovec)); -STATIC_ASSERT(sizeof(&((uv_buf_t*) 0)->base) == +STATIC_ASSERT(sizeof(((uv_buf_t*) 0)->base) == sizeof(((struct iovec*) 0)->iov_base)); -STATIC_ASSERT(sizeof(&((uv_buf_t*) 0)->len) == +STATIC_ASSERT(sizeof(((uv_buf_t*) 0)->len) == sizeof(((struct iovec*) 0)->iov_len)); STATIC_ASSERT(offsetof(uv_buf_t, base) == offsetof(struct iovec, iov_base)); STATIC_ASSERT(offsetof(uv_buf_t, len) == offsetof(struct iovec, iov_len));