Skip to content

A trial problem In branch 3.0 ziplist.c 153 lines ? #2033

Closed

Description

@fateiswar

In branch 3.0 ziplist.c 153 lines
“ if (ZIPLIST_LENGTH(zl) < UINT16_MAX)”
should it be " if (intrev16ifbe(ZIPLIST_LENGTH(zl)) < UINT16_MAX)"
because the ZIPLIST_LENGTH(zl) maybe in big-endian and UINT16_MAX is in little-endian

Activity

  1. mattsta commented on Sep 29, 2014

    @mattsta
    Contributor

    Yeah, looks like an oversight. The other usages of ZIPLIST_LENGTH() are wrapped in intrev16ifbe():

    ziplist.c:154:        ZIPLIST_LENGTH(zl) = intrev16ifbe(intrev16ifbe(ZIPLIST_LENGTH(zl))+incr); \
    ziplist.c:881:    if (intrev16ifbe(ZIPLIST_LENGTH(zl)) < UINT16_MAX) {
    ziplist.c:882:        len = intrev16ifbe(ZIPLIST_LENGTH(zl));
    ziplist.c:891:        if (len < UINT16_MAX) ZIPLIST_LENGTH(zl) = intrev16ifbe(len);
    ziplist.c:911:        intrev16ifbe(ZIPLIST_LENGTH(zl)),
  2. robscary commented on Oct 20, 2014

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions