New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert question in ziplist.c #4587

Closed
Qinch opened this Issue Jan 10, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@Qinch

Qinch commented Jan 10, 2018

#define ZIP_DECODE_PREVLEN(ptr, prevlensize, prevlen) do {                     \
    ZIP_DECODE_PREVLENSIZE(ptr, prevlensize);                                  \
    if ((prevlensize) == 1) {                                                  \
        (prevlen) = (ptr)[0];                                                  \
    } else if ((prevlensize) == 5) {                                           \
        assert(sizeof((prevlensize)) == 4);                                    \
        memcpy(&(prevlen), ((char*)(ptr)) + 1, 4);                             \
        memrev32ifbe(&prevlen);                                                \
    }                                                                          \
} while(0);

ZIP_DECODE_PREVLEN macro in ziplist.c(443lines) at branch 4.0;
Is there an error with this line assert(sizeof((prevlensize)) == 4);
it's sizeof prevlensize instead of prevlen.

Qinch pushed a commit to Qinch/redis_reading that referenced this issue Jan 16, 2018

@Qinch Qinch closed this Jan 18, 2018

antirez added a commit that referenced this issue Jan 18, 2018

JackieXie168 pushed a commit to JackieXie168/redis that referenced this issue Mar 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment