Fix ziplist length updates on bigendian platforms (#2080)

Adds call to intrev16ifbe to ensure ZIPLIST_LENGTH is compared correctly

(cherry picked from commit eaa52719a3)
(cherry picked from commit 4c181230855bb3f92e93b32a48db52e69bd7e509)
This commit is contained in:
Rob Snyder 2021-06-30 09:46:06 -04:00 committed by Oran Agra
parent 8df81c0326
commit 32d923f85a

View File

@ -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); \
}