From c7918378631992d874c99736272ed342d5d77b2c Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 8 Dec 2018 19:03:09 +0100 Subject: executor: fix handling of big-endian bitfields Currently we apply big-endian-ness and bitfield-ness in the wrong order in copyin. This leads to totally bogus result. Fix this. --- executor/test.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'executor/test.h') diff --git a/executor/test.h b/executor/test.h index a5bc8e8f2..c39f611d1 100644 --- a/executor/test.h +++ b/executor/test.h @@ -8,7 +8,7 @@ static int test_copyin() { static uint16 buf[3]; - STORE_BY_BITMASK(uint16, &buf[1], 0x1234, 0, 0); + STORE_BY_BITMASK(uint16, , &buf[1], 0x1234, 0, 16); unsigned char x[sizeof(buf)]; memcpy(x, buf, sizeof(x)); if (x[0] != 0 || x[1] != 0 || @@ -18,7 +18,7 @@ static int test_copyin() x[0], x[1], x[2], x[3], x[4], x[5]); return 1; } - STORE_BY_BITMASK(uint16, &buf[1], 0x555a, 5, 4); + STORE_BY_BITMASK(uint16, , &buf[1], 0x555a, 5, 4); memcpy(x, buf, sizeof(x)); if (x[0] != 0 || x[1] != 0 || x[2] != 0x54 || x[3] != 0x13 || -- cgit mrf-deployment