fix skiplist crash bug
This commit is contained in:
parent
aca8e3644b
commit
3d2a77ea6d
|
@ -466,7 +466,12 @@ static bool tSkipListGetPosToPut(SSkipList *pSkipList, SSkipListNode **forward,
|
||||||
}
|
}
|
||||||
|
|
||||||
SSkipListNode *px = pSkipList->pHead;
|
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);
|
SSkipListNode *p = SL_GET_FORWARD_POINTER(px, i);
|
||||||
while (p != pSkipList->pTail) {
|
while (p != pSkipList->pTail) {
|
||||||
pKey = SL_GET_NODE_KEY(pSkipList, p);
|
pKey = SL_GET_NODE_KEY(pSkipList, p);
|
||||||
|
|
Loading…
Reference in New Issue