Reinitialize pointer 'p' after ziplistDeleteRange to fix head deletion bug (#537)

Fix
https://github.com/valkey-io/valkey/actions/runs/9200055659/job/25305949916

Signed-off-by: Ping Xie <pingxie@google.com>
This commit is contained in:
Ping Xie 2024-05-22 23:37:18 -07:00 committed by GitHub
parent c41dd77a3e
commit a0aebb6b67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -360,7 +360,7 @@ int test_ziplistDeleteInclusiveRange0To0(int argc, char **argv, int flags) {
int orig_len = ziplistLen(zl);
zl = ziplistDeleteRange(zl, 0, 1);
p = ziplistIndex(zl, 0);
TEST_ASSERT(ziplistCompare(p, (unsigned char *)"foo", 3));
int new_len = ziplistLen(zl);
TEST_ASSERT(orig_len - 1 == new_len);