diff options
author | Rob Snyder <robscary@gmail.com> | 2021-06-30 09:46:06 -0400 |
---|---|---|
committer | Oran Agra <oran@redislabs.com> | 2021-07-21 21:07:15 +0300 |
commit | 0dfc71bd6e56ac2473f15fd5149298adfc83680e (patch) | |
tree | 1a7aa11b7f7507ba7e177fe1c22d29765934b83b | |
parent | 265341b577dadcbdd40343bdf32d7dcb0a4bc1d1 (diff) | |
download | redis-0dfc71bd6e56ac2473f15fd5149298adfc83680e.tar.gz |
Fix ziplist length updates on bigendian platforms (#2080)
Adds call to intrev16ifbe to ensure ZIPLIST_LENGTH is compared correctly
(cherry picked from commit eaa52719a355c4467d0383c1c9f5184c9c14fe5a)
-rw-r--r-- | src/ziplist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ziplist.c b/src/ziplist.c index ef40d6aa2..dbd804b11 100644 --- a/src/ziplist.c +++ b/src/ziplist.c @@ -261,7 +261,7 @@ * to stay there to signal that a full scan is needed to get the number of * items inside the ziplist. */ #define ZIPLIST_INCR_LENGTH(zl,incr) { \ - if (ZIPLIST_LENGTH(zl) < UINT16_MAX) \ + if (intrev16ifbe(ZIPLIST_LENGTH(zl)) < UINT16_MAX) \ ZIPLIST_LENGTH(zl) = intrev16ifbe(intrev16ifbe(ZIPLIST_LENGTH(zl))+incr); \ } |