mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
safety assert in listTypeNext
This commit is contained in:
parent
003f0840ff
commit
dda20542ab
3
redis.c
3
redis.c
@ -5029,6 +5029,9 @@ static void listTypeReleaseIterator(listTypeIterator *li) {
|
|||||||
* and advances the position of the iterator. Returns 1 when the current
|
* and advances the position of the iterator. Returns 1 when the current
|
||||||
* entry is in fact an entry, 0 otherwise. */
|
* entry is in fact an entry, 0 otherwise. */
|
||||||
static int listTypeNext(listTypeIterator *li, listTypeEntry *entry) {
|
static int listTypeNext(listTypeIterator *li, listTypeEntry *entry) {
|
||||||
|
/* Protect from converting when iterating */
|
||||||
|
redisAssert(li->subject->encoding == li->encoding);
|
||||||
|
|
||||||
entry->li = li;
|
entry->li = li;
|
||||||
if (li->encoding == REDIS_ENCODING_ZIPLIST) {
|
if (li->encoding == REDIS_ENCODING_ZIPLIST) {
|
||||||
entry->zi = li->zi;
|
entry->zi = li->zi;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user