fix skiplist crash bug

This commit is contained in:
Hongze Cheng 2020-09-17 11:13:06 +08:00
parent aca8e3644b
commit 3d2a77ea6d
1 changed files with 6 additions and 1 deletions

View File

@ -466,7 +466,12 @@ static bool tSkipListGetPosToPut(SSkipList *pSkipList, SSkipListNode **forward,
}
SSkipListNode *px = pSkipList->pHead;
for (int i = pSkipList->level - 1; i >= 0; --i) {
for (int i = pNode->level - 1; i >= 0; --i) {
if (i >= pSkipList->level) {
forward[i] = pSkipList->pHead;
continue;
}
SSkipListNode *p = SL_GET_FORWARD_POINTER(px, i);
while (p != pSkipList->pTail) {
pKey = SL_GET_NODE_KEY(pSkipList, p);