Commit a244a13b authored by antirez's avatar antirez
Browse files

added assertion in zslInsert() that ensures the inserted element score is not NaN

parent 24accab2
...@@ -76,6 +76,7 @@ zskiplistNode *zslInsert(zskiplist *zsl, double score, robj *obj) { ...@@ -76,6 +76,7 @@ zskiplistNode *zslInsert(zskiplist *zsl, double score, robj *obj) {
unsigned int rank[ZSKIPLIST_MAXLEVEL]; unsigned int rank[ZSKIPLIST_MAXLEVEL];
int i, level; int i, level;
redisAssert(!isnan(score));
x = zsl->header; x = zsl->header;
for (i = zsl->level-1; i >= 0; i--) { for (i = zsl->level-1; i >= 0; i--) {
/* store rank that is crossed to reach the insert position */ /* store rank that is crossed to reach the insert position */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment