From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 152B14696C0 for ; Thu, 21 May 2020 23:37:37 +0300 (MSK) From: Vladislav Shpilevoy Date: Thu, 21 May 2020 22:37:24 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 10/10] xrow: use unaligned store operation in xrow_to_iovec() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, korablev@tarantool.org, tsafin@tarantool.org, alyapunov@tarantool.org, gorcunov@gmail.com xrow_to_iovec() tried to save a uint32_t value by a not aligned address. The patch makes it use a special operation for that instead of regular assignment. Part of #4609 --- src/box/xrow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/box/xrow.c b/src/box/xrow.c index 06473a8bc..bb64864b2 100644 --- a/src/box/xrow.c +++ b/src/box/xrow.c @@ -892,7 +892,7 @@ xrow_to_iovec(const struct xrow_header *row, struct iovec *out) /* Encode length */ char *data = (char *) out[0].iov_base; *(data++) = 0xce; /* MP_UINT32 */ - *(uint32_t *) data = mp_bswap_u32(len); + store_u32(data, mp_bswap_u32(len)); assert(iovcnt <= XROW_IOVMAX); return iovcnt; -- 2.21.1 (Apple Git-122.3)