]> git.saurik.com Git - redis.git/commitdiff
added assertion in zslInsert() that ensures the inserted element score is not NaN
authorantirez <antirez@gmail.com>
Sun, 18 Dec 2011 10:12:58 +0000 (11:12 +0100)
committerantirez <antirez@gmail.com>
Sun, 18 Dec 2011 10:12:58 +0000 (11:12 +0100)
src/t_zset.c

index ccf9962a19f206c521f8b966d79aaed9034648ba..99faae858c41f6ba625c73fb4966eabf938bea76 100644 (file)
@@ -76,6 +76,7 @@ zskiplistNode *zslInsert(zskiplist *zsl, double score, robj *obj) {
     unsigned int rank[ZSKIPLIST_MAXLEVEL];
     int i, level;
 
+    redisAssert(!isnan(score));
     x = zsl->header;
     for (i = zsl->level-1; i >= 0; i--) {
         /* store rank that is crossed to reach the insert position */