diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-12-08 19:03:09 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-12-08 19:08:08 +0100 |
| commit | c7918378631992d874c99736272ed342d5d77b2c (patch) | |
| tree | 5e67097471fda876d532c270dc4b7f3db0e850c5 /executor/test.h | |
| parent | 33508266251f6db13ef34741e36b1dce2c9e1b49 (diff) | |
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.
Diffstat (limited to 'executor/test.h')
| -rw-r--r-- | executor/test.h | 4 |
1 files changed, 2 insertions, 2 deletions
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 || |
